How to write soap body as we can write header using WCF.OutboundCustomHeaders
Hello,
I need to set body part of soap message so that I can create line items in one call, other wise I would have to create it with multiple calls to service.
I have a string "<cre:InputParameters> </cre:InputParameters> <cre:InputParameters> </cre:InputParameters> <cre:InputParameters> </cre:InputParameters>"
Which I need to send in body so service can create line items in one call. It is creating when I call via soap UI but using generated schemas I would have to call service three times to create 3 line items and I don't want that.
<soapenv:Envelope >
<soapenv:Header>
<wsse:Security >
<wsse:UsernameToken wsu:Id="">
</wsse:UsernameToken>
</wsse:Security>
<xxt:SHeader>
</xxt:SHeader>
</soapenv:Header>
<soapenv:Body>
<cre:InputParameters>
</cre:InputParameters>
<cre:InputParameters>
</cre:InputParameters>
<cre:InputParameters>
</cre:InputParameters>
</soapenv:Body>
</soapenv:Envelope>
--Hassam
September 14th, 2015 8:28am
Are you the web service consumer or producer?
The WSDL of a SOAP web service defines the calls. So when you're the consumer, then you don't have an option here.
When you're the producer (when you're the guy who has written the web service) then change the WSDL.
September 14th, 2015 8:39am
consumer, but how can I check if service has provided me this option?
September 14th, 2015 8:44am
Hi Hassam,
Are you trying to consume the service?
September 14th, 2015 8:44am
yes trying to consume
September 14th, 2015 8:45am
what is the input request format of that service and also it is fixed that you have to send always 3 times fixed : <cre:InputParameters> </cre:InputParameters>
September 14th, 2015 8:49am
it can be N number of line items
September 14th, 2015 8:52am
Have you
added a web reference?
But I've to admit, that I haven't seen the BizTalk topic. I'm not an expert in this area..
September 14th, 2015 8:53am
Thanks Stefan
September 14th, 2015 8:54am
Hi Hussam,
then you can simply map the incoming request with the service request schema and send to service.Make sure to make the record unbound(*) so that request message can be repeated depending on the incoming request and the transformed output message will be
send to webservice call as soapbody
September 14th, 2015 8:58am
generate schemas do not allow that
September 14th, 2015 9:05am
can you share the structure of schema , may be we can tweak it
September 14th, 2015 9:07am
Generally you don't need to assign body as assigning CustomHeader
You need to tweak the generated schema (maybe you can change MaxOcc to unbound) and try to generate instance then try to replace the generated instance with the body in SOAPUI until it works.
If you want to change body as changing CustomHeader then you need to use a Custom WCF extension which I not prefer to use it in your case.
If you share your wsdl, I can help.
September 14th, 2015 10:23am