BizTalk 2006 SOAP Adapter - Messaging only Web Service Call - soap

In BizTalk 2006, I am trying to set up a messaging-only scenario whereby the recieved message (a string) is passed to a web service method that takes a single string parameter. In other words, the whole body of the BizTalk message should be passed as the parameter to the web service call.
The service method looks like this:
[WebMethod]
public void LogAuditEvent(string auditEventMessage)
I have set up the assembly with the proxy class in the SOAP adapter configuration as required, but I can't figure out how to get the message body to be passed as the parameter. Without doing anything special, I get the following error message:
Failed to serialize the message part
"auditEventMessage" into the type
"String" using namespace "".
I think this means that the adapter cannot find a message part named after the parameter. So, my question is what do I need to do to get my message set up correctly? I was thinking that maybe I needed to add an outbound map, but was not sure what to use as the source schema and how to generate a proper schema for the web service request message.
Does anyone have any pointers on this seemingly simple task?
Thanks.

TDL,
I would take a look at the links below for some tips on how to do this. SOAP adapter can be problematic I would recommend WCF if your using R2. And if not look at the WSE adapters as well.
http://blogs.digitaldeposit.net/saravana/post/2007/01/31/Calling-Web-Service-from-BizTalk-2006-in-a-Messaging-only-Scenario-(aka-Content-based-Routing).aspx
-and-
http://www.pluralsight.com/community/blogs/aaron/archive/2005/10/07/15386.aspx
-and-
http://social.technet.microsoft.com/Forums/en-US/biztalkgeneral/thread/92f2cad3-39b9-47d0-9e6f-011ccd2f9e10/
-Bryan

Related

VSTS release pipeline release gate: how to do HTTP response body string equality check?

I want to check whether my deployed ASP.NET application returns Healthy from health check endpoints or not.
Unfortunately, the success criteria samples of the "Invoke Rest API" release gate only show how to evaluate JSON responses like eq(root['status'], 'successful') or eq(count(jsonpath('Items[?(#.price<50)]')).
As my endpoint doesn't return any JSON I wonder if it's possible to do a simple stupid string equality check somehow?
Of course I could rely on checking the HTTP status code, I feel like it should be possible to access the response body.
This is the exception I get when using eq(root, "Healthy"):
If your endpoint returns just a string try simply this:
eq(root, 'SomeString')
This is really strange that you get such error. It works on my release pipeline:
Here is settings:
And here result:
Agree with Krzysztof Madej
Exception Message: Error parsing API response into a JSON object.
You could check the “URL suffix and parameters” field in “Invoke Rest API task”.
Please make sure that the whole URL is valid.
The whole URL contains the Server URL (Set in service connection) and the URL suffix and parameters (Set in Invoke Rest API task).
Hope this helps.

How to produce both xml and json for a rest based service?

I am trying to produce both xml and json from my rest service.
#Produces({"application/xml", "application/json"})
However, when I try to use the service using curl/SOAPUI, I get back either xml or json depending on which is mentioned first. In simple words, only the first method is considered. Is there a workaround?
You should check this link out - oracle docs for #Produces
The spec says that it does indeed default to the first one if that is acceptable as specified by the media type on the request. You should check your soapUI tool and see what headers you are sending. If they are both being sent you will get a response with the first one listed in your #Produces annotation.

Coldfusion Webservice and SOAP

I am using coldfusion and IIS 7.5
Problem is that when the web service has 500 error, it returns HTML instead of XML.
Can anyone help me in fixing this please.
Thanks.
This is an Internal Server Error, may have occurred because of a data type mismatch. The server is expecting one data type but you are sending a different data type for the input parameter. Please check the input format of the web service that you are calling.
For example: If you try to consume a web service method which takes a SOAP object as an input parameter and you call that method with a different parameter other than SOAP the server will throw a 500 error.

WSDL Cannot find dispatch method for

For a web service call using a WSDL, I'm getting the error Cannot find dispatch method for {http://ws.somecompany.com/services}ValidateUser, what does that mean exactly? Does it mean that it cannot find ValidateUser?
This typically means that the SOAP framework could not find the operation that should be invoked via this request. A SOAP framework typically inspects the message to find pointers about how to route the message to the operation. Reasons for this error are mostly configuration issues (different namespaces, different encodings (RPC vs. doc/lit), usage of WS-Addressing vs. plain SOAP etc.)
I had a similar problem and struggling, googling for 1 day. But it was a simple mistake that instead of:
{http://ws.somecompany.com/services}ValidateUser
It should be
{http://ws.somecompany.com/services/}ValidateUser
I had not checked my WSDL clearly.
In my case I solved by making sure that my config file either app.config or web.config depending on your client has correct endpoint. I had wrong address in my endpoint. I changed it and it worked fine.
I also lost a day to this issue, albeit with a different root cause.
In our case, two similar endpoint urls had got mixed up in the properties file. Both services were present and running, but the WSDLs didn't match up, so instead of a ConnectionException, we were getting this SOAPFaultException: "Cannot find dispatch method".
My fifty cent, I got same error message but my case was yet different from all above, so hopefuly it might help someone.
I had .wsdl file, which got outdated without my knowledge when colleagues on the other side of ws renamed some element. Unfortunately, change was not visible when I compared .wsdl with theirs because .wsdl file had .xsd import which actually contained renamed element. After I found change, I updated my .xsd file and tada! error is gone and it worked.
In my case, the following exception was throwing even I've supplied all the parameters
SoapFault exception: [S:Client] Cannot find dispatch method for {}parameters in
After banging my head few hours, just adding a \ while initializing SoapClient solved the problem.
From:
$client = new SoapClient($soapURL);
To:
$client = new \SoapClient($soapURL);
I had the same issue in my .NET Application, In my case setting url same as "http://x-xxx-xx-xx-01:8080//TestProject/testproject?wsdl" (dummy url) solved the problem in the below code.
Vb.Net
Dim rptGen as WSTestProject.testproject = Nothing
rptGen = New WSTestProject.testproject With {
.Url = "http://x-xxx-xx-xx-01:8080//TestProject/testproject?wsdl",
.Timeout = 1200000
}
Here, WSTestProject is the WebService NameSpace and testproject is the web method.
I am using a feign client for soap and I had the similar issue,Adding the correct namespace to the JAXB request and response object resolve the issue.
The issue was in my environment was the wsdl cache in php. The updated wsdl was not picked by the client and it was referring to the old wsdl.
You can do either one of the following options when you do the development of the web service and test, as the wsdl change during the update/implementation of the web service
Add WSDL_CACHE_NONE to soap client creation
$myServices_client = new SoapClient($myServices_wsdl_URL, array('cache_wsdl' => WSDL_CACHE_NONE) );
Set initialization parameter
ini_set("soap.wsdl_cache_enabled", 0);
Adding '/' will work for you.
Error: Cannot find dispatch method for {http://zzz.com}servicename
Not Working Request: xmlns:ser='http://zzz.com'>
Working Request: xmlns:ser='http://zzz.com/'>
I picked up an old Java project. I am not sure how it worked before, but I saw similar error and the reason was in wrong SOAP HTTP endpoint binding at server side.
Doesn't work:
Endpoint.create(HTTPBinding.HTTP_BINDING, servicePortType);
Works:
Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, servicePortType);

WSDL empty <types> tag and YAWS SOAP support

I am trying to invoke a WebService through SOAP using Erlang and YAWS (yaws_soap_lib module specifically). The examples published on http://yaws.hyber.org/soap_intro.yaws work for me.
However, when trying to invoke my own web service YAWS fails. The first problem were partner links in the WSDL that were put there because of BPEL is befind this service. I deleted them (for now).
Unfortunately, I've come across another problem: mentioned WSDL has an empty <types> tag. Now, I am not very familiar with WSDL specification and SOAP so my question is whether it is
Erlang SOAP library issue that cannot handle empty <types> tag or
badly generated WSDL?
Does anyone know any better Erlang library for handling SOAP? I have taken a look at erlsoap but it does not support WSDLs.
EDIT: error caused by mentioned WSDL:
::error:function_clause
in function erlsom_add:add_model/2
called as add_model({model,[{type,'_document',sequence,
[{el,[{alt,'soap:Envelope','soap:Envelope',...},
{alt,'soap:Header',...},
{alt,...},
{...}],
1,1,1}],
[],undefined,undefined,1,1,1,false,...},
{type,'soap:detail',sequence,
[{el,[{alt,'#any',...},{alt,...},{...}|...],0,unbound,1}],
[],
{anyAttr,"lax","##any",[...]},
undefined,2,1,1,...},
{type,'soap:Fault',sequence,
[{el,[{alt,...}],1,1,...},
{el,[{...}],1,...},
{el,[...],...},
{el,...}],
[],undefined,undefined,5,1,...},
{type,'soap:Body',sequence,
[{el,[{...}|...],0,...}],
[],
{anyAttr,[...],...},
undefined,2,...},
{type,'soap:Header',sequence,
[{el,[...],...}],
[],
{anyAttr,...},
undefined,...},
{type,'soap:Envelope',sequence,[{el,...},{...}|...],[],{...},...}],
[{ns,"http://schemas.xmlsoap.org/soap/envelope/","soap"},
{ns,"http://www.w3.org/2001/XMLSchema","xsd"}],
"http://schemas.xmlsoap.org/soap/envelope/",[]},undefined)
in call from yaws_soap_lib:initModel2/5
For those who are familiar with the source code: The problem is the Xsds array returned by getXsdsFromWsdl function is empty.
My XML schema fu is a bit rusty, but as far as I can see the schema permits empty <types/> elements. That would suggest the first alternative, though it's hard to be sure. What error message do you get?
I would guess given the function clause error that erlsom is not handling some particular function input as being undefined. But I assume you've already validated your WSDL to make sure it's OK? Also, any chance of posting the WSDL somewhere so we can see it?
The issue has been resolved in latest YAWS version. In order to construct mentioned WSDL model following command has to be invoked:
yaws_soap_lib:initModel(WSDL_FILE_URL, [{include_fun, {erlsom_lib, find_xsd}}])