Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / July 2004

Tip: Looking for answers? Try searching our database.

Not Receiving Results from Java Webservice

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric - 23 Jul 2004 18:30 GMT
Hello,

I have a c# client program that sends a userID and Password to a
webservice that validates the user. The client is sucessfully sending
the Client context and the webservice is receiving it and processing
it, but I don't get back the ReturnCode saying wether it was OK or
not. Here is a snippet from the client code and the code generated by
the wsdl file.

Client Code that is sending the Client Context and receiving the
results.

TDMSOAPProxyService webService = new TDMSOAPProxyService();
ClientContext clientContext = new ClientContext();
clientContext.tdmUserId = logonId;
clientContext.tdmPassword = password;
           
TDMBASE64SOAPResult results = webService.logon(clientContext , args);
    Error = results.errors;
    Results = results.result;
    ReturnCode = results.returnCode;

Here is the code generated from the WSDL

[System.Web.Services.Protocols.SoapRpcMethodAttribute("",
RequestNamespace="TdmSoapCli", ResponseNamespace="TdmSoapCli")]
       [return: System.Xml.Serialization.SoapElementAttribute("logonReturn")]
       public TDMBASE64SOAPResult logon(ClientContext ctx, string[]
args) {
           object[] results = this.Invoke("logon", new object[] {
                       ctx,
                       args});
           return ((TDMBASE64SOAPResult)(results[0]));
       }
       
       /// <remarks/>
       public System.IAsyncResult Beginlogon(ClientContext ctx,
string[] args, System.AsyncCallback callback, object asyncState) {
           return this.BeginInvoke("logon", new object[] {
                       ctx,
                       args}, callback, asyncState);
       }
       
       /// <remarks/>
       public TDMBASE64SOAPResult Endlogon(System.IAsyncResult
asyncResult) {
           object[] results = this.EndInvoke(asyncResult);
           return ((TDMBASE64SOAPResult)(results[0]));
       }
   }
   
   /// <remarks/>
   [System.Xml.Serialization.SoapTypeAttribute("ClientContext",
"TdmSoapCli")]
   public class ClientContext {
       
       /// <remarks/>
       public string tdmPassword;
       
       /// <remarks/>
       public string vault;
       
       /// <remarks/>
       public string tdmUserId;
   }
   
   /// <remarks/>
   [System.Xml.Serialization.SoapTypeAttribute("BASE64Attachment",
"TdmSoapCli")]
   public class BASE64Attachment {
       
       /// <remarks/>
       [System.Xml.Serialization.SoapElementAttribute(DataType="base64Binary")]
       public System.Byte[] attachment;
       
       /// <remarks/>
       public string fileName;
   }
   
   /// <remarks/>
   [System.Xml.Serialization.SoapTypeAttribute("TDMBASE64SOAPResult",
"TdmSoapCli")]
   public class TDMBASE64SOAPResult {
       
       /// <remarks/>
       public string[] result;
       
       /// <remarks/>
       public int returnCode;
       
       /// <remarks/>
       public BASE64Attachment attachment;
       
       /// <remarks/>
       public string[] errors;
Dino Chiesa [Microsoft] - 28 Jul 2004 06:45 GMT
suspect a namespace disagreement.
use a trace tool to look at the data flowing back and forth.
eg proxytrace (google for it, it's free).

-D

> Hello,
>
[quoted text clipped - 68 lines]
>
>         /// <remarks/>

[System.Xml.Serialization.SoapElementAttribute(DataType="base64Binary")]
>         public System.Byte[] attachment;
>
[quoted text clipped - 18 lines]
>         /// <remarks/>
>         public string[] errors;
Eric Swaney - 28 Jul 2004 12:33 GMT
Thanks, I used proxytrace and this is what I received back from the
webservice.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
 <ns1:logonResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="TdmSoapCli">
  <ns1:logonReturn xsi:type="ns1:TDMBASE64SOAPResult">
   <ns1:result xsi:type="soapenc:Array"
soapenc:arrayType="xsd:string[2]"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item>ORA-01017: invalid username/password; logon denied</item>
    <item> </item>
   </ns1:result>
   <ns1:returnCode xsi:type="xsd:int">255</ns1:returnCode>
   <ns1:attachment xsi:type="ns1:BASE64Attachment" xsi:nil="true"/>
   <ns1:errors xsi:type="soapenc:Array"
soapenc:arrayType="xsd:string[3]"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item>Process returned error exitcode: 255</item>
    <item>ORA-01017: invalid username/password; logon denied</item>
    <item> </item>
   </ns1:errors>
  </ns1:logonReturn>
 </ns1:logonResponse>
</soapenv:Body>
</soapenv:Envelope>

This is the code that was generated by the WDSL

       [System.Web.Services.Protocols.SoapRpcMethodAttribute("",
RequestNamespace="TdmSoapCli", ResponseNamespace="TdmSoapCli")]
       [return:
System.Xml.Serialization.SoapElementAttribute("logonReturn")]
       public TDMBASE64SOAPResult logon(ClientContext ctx, string[]
args) {
           object[] results = this.Invoke("logon", new object[] {
                       ctx,
                       args});
           return ((TDMBASE64SOAPResult)(results[0]));
       }

[System.Xml.Serialization.SoapTypeAttribute("TDMBASE64SOAPResult",
"TdmSoapCli")]
   public class TDMBASE64SOAPResult {
   /// <remarks/>
       public string[] result;
   /// <remarks/>
       public int returnCode;
   /// <remarks/>
       public BASE64Attachment attachment;
   /// <remarks/>
       public string[] errors;
}
Dino Chiesa [Microsoft] - 28 Jul 2004 21:36 GMT
Ok, I don't see anything here.
One path forward might be to create a Java client, trace the SOAP, and
compare that with what you are getting on the .NET side.

----
Any chance you could convert the Java server to be doc/literal rather than
rpc/encoded?

doc/lit is what is recommended by WS-I for interoperable web services.  SOAP
section-5 encoding is no longer recommended by anyone.

-D

> Thanks, I used proxytrace and this is what I received back from the
> webservice.
[quoted text clipped - 55 lines]
>         public string[] errors;
> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.