ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Customised SOAP Fault message

Post new topic  Reply to topic
 Customised SOAP Fault message « View previous topic :: View next topic » 
Author Message
GeneRK4
PostPosted: Mon Apr 21, 2014 6:23 am    Post subject: Customised SOAP Fault message Reply with quote

Master

Joined: 08 Jul 2013
Posts: 220

I have a requirement to create soap fault message which looks different from broker default SOAP Fault structure.
We have Error schema given as,
<xs:schema targetNamespace="http://schems.xyz.com/common/error_v1_0" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schems.xyz.com/common/error_v1_0" xmlns:err="http://schems.xyz.com/common/error_v1_0">
....
-<xs:element name="xyzError" type="xyzError_Master"> -<xs:annotation> <xs:documentation>Common standard xyz Error Message.</xs:documentation> </xs:annotation> </xs:element>
...

So,looks like the below type of SOAPFault message is expected,
<Body>
<xyzError>
<ErrorCode> 12 </ErrorCode>
<ErrorDesc> Invalid message </ErrorDesc>
<xyzError>
</Body>

Instead of ,
<Body>
<Fault>
<FaultCode>12<FaultCode>
<FaultString><FaultString>
</Fault>
</Body>

WSDL part defining Fault:

-<wsdl:operation name="putConceptGroupSequence"> <wsdl:input message="tns:putConceptGroupSequenceRequest"/> <wsdl:output message="tns:putConceptGroupSequenceResponse"/> <wsdl:fault name="fault" message="tns:putConceptGroupSequenceFault"/> </wsdl:operation>

-<wsdl:operation name="getConceptGroupProductGroup"> <soap:operation soapAction="http://www.example.org/StoreInformationService/getConceptGroupProductGroup"/> -<wsdl:input> <soap:body use="literal"/> </wsdl:input> -<wsdl:output> <soap:body use="literal"/> </wsdl:output> -<wsdl:fault name="fault"> <soap:fault name="fault" use="literal"/> </wsdl:fault>

When I used below code,Error message is thrown for SOAP xml tree bitstream and it says "expecting out or fault'.I am not sure how to create SOAP fault for this requirement.Please provide some suggestions...

Code:
SET OutputRoot.SOAP.Body.ns4:xyzError.ErrorCode = faultcode;
SET OutputRoot.SOAP.Body.ns4:xyzError.ErrorType = faultcode;
SET OutputRoot.SOAP.Body.ns4:xyzError.ErrorDescription = faultstring;
SET OutputRoot.SOAP.Body.ns4:xyzError.Timestamp = CURRENT_TIMESTAMP;


SET OutputLocalEnvironment.Destination.SOAP.Reply.Transport.HTTP.ReplyStatusCode = 500;
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 21, 2014 6:55 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

SOAP Faults have a Fault tag, not a Body tag. So if the WSDL is asking for what you think it's asking for it's another kind of output not a fault and that's why WMB is complaining.

Does the WSDL validate through XMLSpy or similar?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 21, 2014 6:57 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Also your code doesn't seem to be assembling what that WSDL fragment is asking for anyway.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
GeneRK4
PostPosted: Mon Apr 21, 2014 11:42 pm    Post subject: Reply with quote

Master

Joined: 08 Jul 2013
Posts: 220

Vitor wrote:
SOAP Faults have a Fault tag, not a Body tag. So if the WSDL is asking for what you think it's asking for it's another kind of output not a fault and that's why WMB is complaining.

Does the WSDL validate through XMLSpy or similar?


I wentthrough the link,
http://www.w3schools.com/webservices/ws_soap_fault.asp

I found that if we need to provide application specific error,it has to come under "detail" segment.
So,the entire SOAPFault structure we cannot change I guess...

<faultcode>, <faultstring>,<faultactor> under Fault seems to be mandatory.
<detail>

Please correct me if I am wrong..
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 22, 2014 4:56 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

GeneRK4 wrote:
So,the entire SOAPFault structure we cannot change I guess...




GeneRK4 wrote:
Please correct me if I am wrong..



_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Apr 22, 2014 5:03 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

However you can put whatever structure you want under the details tag of the SOAP:Fault message...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
GeneRK4
PostPosted: Tue Apr 22, 2014 8:24 pm    Post subject: Reply with quote

Master

Joined: 08 Jul 2013
Posts: 220

Thank you experts ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Customised SOAP Fault message
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.