Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting error while calling the .net web service from java code.

 
bablu singh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am calling .net web service from java code (web service client). I'm getting the following error
com.sun.xml.messaging.saaj.soap.ver1_2.Fault1_2Impl checkIfStandardFaultCode
SEVERE: SAAJ0435: {http://www.w3.org/2003/05/soap-envelope}Client is not a standard Code value

When i run the request using soapUI
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:urn="urn:ihe:qrph:2009" xmlns:urn1="urn:hl7-org:v3"
xmlns:a="http://www.w3.org/2005/08/addressing">
<soap:Header>
<a:Action soap:mustUnderstand="1">urn:ihe:qrph:2009:EmployeeRequestRequest</a:Action>
<a:MessageID>urn:uuid:fb2060ee-555f-4a2c-9851-b6d1c5c5bd79</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To soap:mustUnderstand="1">http://xxxxxxxxxxxxxxxxxxxxxxxxxxx/execute.svc</a:To>
</soap:Header>
<soap:Body>
<urn:EmployeeRequestRequest>
<urn:employee>
<urn:candidateID root="?" extension="?"/>
<urn:name urn1:use="?">
<urn1:prefix qualifier="?">?</urn1:prefix>
<urn1:given qualifier="?">?</urn1:given>
<urn1:family qualifier="?">?</urn1:family>
<urn1:suffix qualifier="?">?</urn1:suffix>
<urn1:delimiter qualifier="?">?</urn1:delimiter>
</urn:name>
<urn:address>
<urn1:city>?</urn1:city>
<urn1:state>?</urn1:state>
<urn1:postalCode>?</urn1:postalCode>
<urn1:country>?</urn1:country>
</urn:address>
<urn:dob value="?"/>
</urn:employee>
</urn:EmployeeRequestRequest>
</soap:Body>
</soap:Envelope>

it gives me the response as

HTTP/1.1 500 Internal Server Error
Date: Tue, 15 Nov 2011 10:14:21 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 424

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1"/>
<a:RelatesTo>urn:uuid:fb2060ee-555f-4a2c-9851-b6d1c5c5bd79</a:RelatesTo>
</s:Header>
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Client</s:Value>
</s:Code>
<s:Reason>
<s:Text xml:lang="en-US">Required Information Missing: 'protocolID'</s:Text>
</s:Reason>
</s:Fault>
</s:Body>
</s:Envelope>

s:Client is creating the problem. Why web service is not giving the proper response?
Any help will be appreciated.
Thanks
 
Santhosh ayiappan
Ranch Hand
Posts: 80
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The response says
Required Information Missing: 'protocolID'
. Check the wsdl and pass this field also in your request.

Regards
Santhosh
 
bablu singh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two cases, when i pass correct information, it works fine without any fault.
But if i pass the unknown values in the soap request then it gives me the

<s:Value>s:Server</s:Value>
as a soap response, in Text field it display

<s:Text xml:lang="en-US">Invalid patient identifier.</s:Text>
and if i send blank fields then it gives me the

<s:Value>s:Client</s:Value>
as a soap response.
I want to handle both cases. So kindly let me know how to resolve this problem.
 
bablu singh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody tell me Does CXF support soap 1.2 messages?

If yes, then how to handle the soap faults, because it generates the run time exception
com.sun.xml.messaging.saaj.soap.ver1_2.Fault1_2Impl checkIfStandardFaultCode
SEVERE: SAAJ0435: {http://www.w3.org/2003/05/soap-envelope}Server is not a standard Code value

java.lang.reflect.UndeclaredThrowableException
at $Proxy33.enrollRequest(Unknown Source)
at ihe.qrph.rpe._2009.IPExecutor_Client.main(IPExecutor_Client.java:122)
Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: {http://www.w3.org/2003/05/soap-envelope}Server is not a standard Code value
at com.sun.xml.messaging.saaj.soap.ver1_2.Fault1_2Impl.checkIfStandardFaultCode(Fault1_2Impl.java:146)
at com.sun.xml.messaging.saaj.soap.impl.FaultImpl.setFaultCode(FaultImpl.java:139)
at com.sun.xml.messaging.saaj.soap.impl.FaultImpl.setFaultCode(FaultImpl.java:157)
at org.apache.cxf.jaxws.JaxWsClientProxy.createSoapFault(JaxWsClientProxy.java:218)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:152)
... 2 more

Thanks.
 
H Paul
Ranch Hand
Posts: 471
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general:

Ensure .NET Server and Java client use the same soap protocol

1. Check the .NET wsdl to see what version it is and what soap message version it expect.
(A side note/link: What's New in SOAP 1.2 http://hadleynet.org/marc/whatsnew.html)

2. Use Java web service soap engine to generate client for that SOAP version.

Data validation:

If the server expect any mandatory value/field, then send it. Otherwise,
server will throw error back to client either missing value OR invalid value.

JAX-WS based implementation: http://cxf.apache.org/ You find the answer
( See WS-* and related Specifications Support)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic