开发者

WCF client returns "nothing" as a response to a third party webservice

I have a 3rd party webservice (happens to be a peoplesoft EIP service) that I'm trying to call from .net. I've tried using a service reference and the old web reference to call this service and every time I call it I get a response of "nothing" back from the service.

I've ran the service call through SoapUI and it works fine. I've captured the network traffic using Fiddler and notice that when i call the service from SoapUi or from .Net I get the same resulting xml back from the call. So that means the call is working. I've turned on tracing and logging within WCF and I'm not seeing any errors. Nor is it throwing an exception.

So my theory is that .net is having a hard time translating the xml from the service back into a .net object.

Here is a snippet of my code:

Dim psclient As New psService.LSS_WEBORDER_PortTypeClient

Dim psreq As New psService.LSS_WEBORDER_REQ_MSG_TypeShape
psreq = New psService.LSS_WEBORDER_REQ_MSG_TypeShape

Dim orderinfo(1) As psService.Transaction_TypeShape

Dim captureid As String = "WB" & Right(Guid.NewGuid.ToString, 8)
orderinfo(0) = New psServic开发者_开发百科e.Transaction_TypeShape
orderinfo(0).LSS_WEBOHDR_WRK = New psService.LSS_WEBOHDR_WRKMsgDataRecord_TypeShape
orderinfo(0).LSS_WEBOHDR_WRK.CAPTURE_ID = New psService.CAPTURE_ID_TypeShape
orderinfo(0).LSS_WEBOHDR_WRK.CAPTURE_ID.Value = captureid

psreq.MsgData() = orderinfo

Dim response As New psService.LSS_WEBORDER_RESP_MSG_TypeShape
response = psclient.LSS_WEBORDER_OP(psreq)
response.ToString() <-- this throws an exception because "response" is nothing. 
psclient.Close()

Any help would be appreciated.

Paul


I figured it out today with a little help from a colleague and some deep Google digging.

Basically the namespace the peoplesoft WSDL had was: http://xmlns.oracle.com/Enterprise/Tools/schemas/LSS_WEBORDER_RESP_MSG.v1 But after some digging i noticed the namespace on the response was different: http://peoplesoft.com/LSS_WEBORDER_RESP_MSGResponse

So i have two options. 1. Change the namespace in the wsdl before i generate my proxy classes. 2. Modify the reference.vb proxy class to have the correct namespace.

I'm choosing option 1 for now. I wish there was a better way.

I got some help from here: http://www.primordialcode.com/index.php/2008/10/15/invoking-javaaxis-web-service-net-return-null-issue/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜