Invoking external web methods with BPEL + Apache Ode (calling .Net asmx) problems - eclipse

Pre-info:
I'm learning to use orchestration of web methods(WM). I've sucessfully completed lessons with assings, invoking web methods, some parallel processing in BPEL. I'm using Eclipse Indigo 3.7.1 with BPEL plugins, Tomcat7 server with Apache Ode as orchestration base. At other side I need to learn calling secured WMs written on Mono .Net platform.
Having now:
Now I'm having problem calling ANY web methods. I've made:
1) Web Method running by Mono .Net - works, can be tested with browser (http://localhost:8081/hwws.asmx ) and with Eclipse tool "Web Services Explorer", it works fine.
2) my BPEL that only invokes this .Net web method throught SOAP port.
3) at other work stantion I've made .Net service with Visual Studio. Having errors either, if need I'll post it text later.
Problem: I'm getting errors at invoking.
Screens:
1) browser test of .net WS HW(helloWorld) http :// photo -hosting.winsoftmagic .com/ 1/ s4nbwdsqib.jpg
2) Eclipse test of .net WS HW http://photo-hosting.winsoftmagic.com/1/zywnl2wtgu.jpg
3) Error I get http://photo-hosting.winsoftmagic.com/1/ltbexoxcdl.jpg
Error listing:
18:15:25,294 WARN ExternalService Fault response: faultType=(unkown)
soap:ClientCould not deserialize Soap message
18:15:25,376 ERROR INVOKE Failure during invoke:
18:15:25,382 INFO BpelRuntimeContextImpl ActivityRecovery: Registering activity 11, failure reason: on channel 21
And it's give timeout error later. I've spent a week around this problems already, searched with all ways I could think up.
EDIT 12.03.2012:
Now test with mono WS worked for some reason.
I've tryed call WS from the internet and it gave the same error as I had at work spot:
14:25:16,177 ERROR [INVOKE] Failure during invoke: Error sending message (mex={PartnerRoleMex#hqejbhcnphr747jefui9ic [PID {http://wsaspx.tns/}inetWS-24] calling org.apache.ode.bpel.epr.WSAEndpoint#1e3a4c7.checkText(...) Status ASYNC}): The input stream for an incoming message is null.
14:25:16,178 INFO [BpelRuntimeContextImpl] ActivityRecovery: Registering activity 11, failure reason: Error sending message (mex={PartnerRoleMex#hqejbhcnphr747jefui9ic [PID {http://wsaspx.tns/}inetWS-24] calling org.apache.ode.bpel.epr.WSAEndpoint#1e3a4c7.checkText(...) Status ASYNC}): The input stream for an incoming message is null. on channel 21
In same time this service works from all test forms.
Edit: 16.03.2012
My mono method stopped work same as it started without my understanding. TcpMon-1.1.jar shows such message again:
POST /hwws.asmx HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://hwws.tps/HelloWorld"
User-Agent: Axis2
Host: localhost:8092
Transfer-Encoding: chunked <--- EDITED: REASON OF NOT WORKING ----
31c
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<addr:To xmlns:addr="http://www.w3.org/2005/08/addressing">http://localhost:8092/hwws.asmx</addr:To>
<addr:Action xmlns:addr="http://www.w3.org/2005/08/addressing">http://hwws.tps/HelloWorld</addr:Action>
<addr:ReplyTo xmlns:addr="http://www.w3.org/2005/08/addressing"><addr:Address>http://www.w3.org/2005/08/addressing/anonymous</addr:Address></addr:ReplyTo>
<addr:MessageID xmlns:addr="http://www.w3.org/2005/08/addressing">uuid:hqejbhcnphr74k7fapcntd</addr:MessageID>
</soapenv:Header>
<soapenv:Body><HelloWorld xmlns="http://hwws.tps/">
<s0:st xmlns:s0="http://hwws.tps/">My test message</s0:st>
</HelloWorld></soapenv:Body></soapenv:Envelope>
0
HTTP/1.0 500 Internal Server Error
Date: Fri, 16 Mar 2012 08:01:50 GMT
Server: Mono.WebServer2/0.4.0.0 Unix
Connection: close
X-AspNet-Version: 4.0.30319
Content-Length: 366
Cache-Control: private
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body><soap:Fault><faultcode>soap:Client</faultcode>
<faultstring>Could not deserialize Soap message</faultstring>
</soap:Fault></soap:Body></soap:Envelope>
Actually I get one of 3 errors: couldn't deserialise, The input stream for an incoming message is null or even error 411 yesterday:) P.s. had 4th error with no socket connecting also, but all them vanished.
My main goal is ssl+authorisation .net services - would be gratefull if you have examples.
Thanks a lot to everyone! It's real pleasure to see your help:)

Thanks to all, testing soap-body shown that it was good and problem was in headers part which had some strange "Chunked" and numbers before xml (length of xml text) and 0 after xml end. I just set http.request.chunk=false and now it work at all my tests yet. For that purpose download sample.endpoint from http://ode.apache.org/endpoint-configuration.html , renamed it as bpel name (MonoCaller.bpel => MonoCaller.endpoint). It has string for chunked already commented. And also added something like http.default-headers.authorization=Basic <64b code of "login:password" made in any coder> for authorization purpose and it also works now! :-]

The same error has occured with me, the problem was with the web service itself, I had an empty constructor plus the methodes wich causes a problem, the solution is to delete the constructor.

Related

Error while using authorization in SoapUI

I am trying to test my SOAP webservice running on weblogic 12c (which is not installed locally) using SoapUI as a client. Without authorization everything works fine, but when I implement very simple UserToken on server and do every step described here:
https://www.soapui.org/soap-and-wsdl/authenticating-soap-requests.html
then I've got following error:
<faultcode>wsse:InvalidSecurityToken</faultcode>
<faultstring>Security token failed to validate. weblogic.xml.crypto.wss.SecurityTokenValidateResult#211ca945[status: false][msg UNT Error:Message Created time past the current time even accounting for set clock skew]</faultstring>
Also I've looked to the http log of SoapUI and I've noticed something strange there:
Tue Mar 20 09:15:52 CET 2018:DEBUG:>>
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="..." xmlns:wsu="...">
<wsse:UsernameToken wsu:Id="UsernameToken-374B6AAD9B07D377D515215337525091">
<wsse:Username>user</wsse:Username>
<wsse:Password Type="...#PasswordText">password</wsse:Password>
<wsse:Nonce EncodingType="...#Base64Binary">urRvoAYbjjovfD0OQqvJ6g==</wsse:Nonce>
<wsu:Created>2018-03-20T08:15:52.464Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
The time of log (which is current one) is different then in <wsu:Created> tag. I don't know if it is important, but I am in UTC+01:00 time zone.
EDIT
I've give up with SoapUI and I've implemented my own Java client with authorization using CredentialProvider:
((BindingProvider) port).getRequestContext().put(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credentialProviders);
And then it was the same! So probably it isn't SoapUI problem, but something else.
Exception in thread "main" com.sun.xml.ws.fault.ServerSOAPFaultException:
Client received SOAP Fault from server: Security token failed to validate. weblogic.xml.crypto.wss.SecurityTokenValidateResult#37b70a09[status: false]
[msg UNT Error:Message Created time past the current time even accounting for set clock skew] Please see the server log to find more detail regarding exact cause of the failure.
at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:193)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:131)
at com.sun.xml.ws.client.sei.StubHandler.readResponse(StubHandler.java:253)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:203)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:290)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:92)
...
When I've looked to the message using Wireshark, time in header was also decrease by one hour. That is really strange and I have no idea what is going on. How am I supposed to test my webservice using authorization? Locally I am using Windows 7, but my Weblogic is running on CentOS 7. As I said both are set to UTC+01:00.
OK, I finally menage to solve this issue. It turns out that server time is late for 2 minutes comparing to the local machine time. Webservice requires time between client and server cannot be larger then few seconds. When I adjusted time everything is working properly.
Additionally, current time in log Mar 20 09:15:52 CET 2018 and time in message 2018-03-20T08:15:52.464Z are equal, but just in different format.

Mobile First 7.1 SOAP Adapter failed to read response

I have used IBM MobileFirst Studio V7.1 - Service Discovery wizard option and created a SOAP adapter from a application WSDL file. The Service Discovery procedure correctly creates the MobileFirst adapter in the MFP Studio.
The sample message payload is as follows.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fet="http://siebel.com/asi/Fetch Account Info">
<soapenv:Body>
<fet:ExecuteFetchAccountInfo_Input>
<fet:Object_spcId>1-6U8KAR</fet:Object_spcId>
</fet:ExecuteFetchAccountInfo_Input>
</soapenv:Body>
</soapenv:Envelope>
Now, using the adapter testing option in the MobileFirst Studio, the following JSON payload are being passed in the dialog window
params:
{"ExecuteFetchAccountInfo_Input":{"Object_spcId":"1-6U8KAR"}}
But I get the following error when I call the adapter
{
"errors": [
"Runtime: Failed to read the HTTP response to: \/eai_enu\/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute \njava.io.EOFException: Unexpected end of ZLIB input stream"
],
"info": [
],
"isSuccessful": false,
"warnings": [
]
}
Also when I tried to check the log files. I was able to capture the request and response.
Request:
[2/16/16 11:27:10:997 IST] 000001ce com.worklight.integration.model.ProcedureInvoker I FWLSE0318I: request:
/eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<tns:ExecuteFetchAccountInfo_Input xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://siebel.com/asi/Fetch Account Info" xmlns:xsdLocal1="http://www.siebel.com/xml/Account%20IO" >
<tns:Object_spcId>1-6U8KAR</tns:Object_spcId>
</tns:ExecuteFetchAccountInfo_Input>
</soap:Body>
</soap:Envelope>
Response:
response:
OK
Date=Tue, 16 Feb 2016 05:34:35 GMT
Server=Microsoft-IIS/6.0
X-Powered-By=ASP.NET
_charset=UTF-8
cache-control=no-cache, must-revalidate, max-age=0
pragma=no-cache
transfer-encoding=Chunked
content-type=text/xml;charset=UTF-8
[project IBMBankProject]
[2/16/16 11:27:11:000 IST] 000001ce om.worklight.integration.services.impl.DataAccessServiceImpl E FWLSE0099E: An error occurred while invoking procedure [project IBMBankProject]SoapAdapter1/HttpRequestFWLSE0100E: parameters: [project IBMBankProject]
Failed to read the HTTP response to: /eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute
java.io.EOFException: Unexpected end of ZLIB input stream
FWLSE0101E: Caused by: [project IBMBankProject]java.lang.RuntimeException: java.io.EOFException: Unexpected end of ZLIB input streamjava.lang.RuntimeException: Failed to read the HTTP response to: /eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute
java.io.EOFException: Unexpected end of ZLIB input stream
By looking at the response it says the response if Ok but it is unable to read it. Please help if I need to set-up something extra to read the response.
It turns out that there was a defect here that needed to be fixed. The APAR number is PI67417 and it can be downloaded from Fix Central.
Once you've applied the iFix, you'll also need to add "Accept-Encoding: identity" to your adapter call. That should resolve your issue. If it doesn't please let me know.
Since this is working in SOAP UI but fails in the adapter, it may indicate a product defect. Please open an IBM PMR and provide your files for reproduction by the development team.

OSB - Processing Http errors from Restful service in Proxy Service

I'm invoking a REST service from an OSB Proxy Service, which is working fine if the rest service response is a valid response, i.e., there's no errors. However if the rest service replies with an http error code (e.g. 400 Bad Request), I'm not able to capture anything else except the http error code:
$fault variable in OSB:
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-382502</con:errorCode>
<con:reason>
OSB Service Callout action received an error response
</con:reason>
<con:details>
<con1:ErrorResponseDetail xmlns:con1="http://www.bea.com/wli/sb/stages/transform/config">
<con1:http-response-code>400</con1:http-response-code>
</con1:ErrorResponseDetail>
</con:details>
<con:location>
<con:node>PipelinePairNode1</con:node>
<con:pipeline>PipelinePairNode1_request</con:pipeline>
<con:stage>stage1</con:stage>
<con:path>request-pipeline</con:path>
</con:location>
</con:fault>
But the rest service, is not only replying with 400 Bad Request, but also adding a message:
<Error>
<Message>The message header contains an invalid brand code.</Message>
</Error>
Which I'm not able to process in my proxy service. Does anyone knows if it is possible to access this message details in OSB or is it a limitation?
The rest service is clearly sending the message, because invoking it directly through soap-ui I'll get the following response:
HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 84
Content-Type: application/xml; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 09 Feb 2015 16:15:32 GMT
<Error><Message>The message header contains an invalid brand code.</Message></Error>
Thanks
I've just found out this is an OSB bug, in case of an HTTP Error code 400 being returned, if the http-content is "Application/XML" the message is ignored.
Oracle released a Patch at the end of last month to fix this issue, which I've tested and it works. I can get the message details in the $body variable now.
Patch: 16986497
If I understand your question, you want to get in addition to the http code, the message error?
I think you should use, in your message flow, an errorHandler , so that you can catch the error and do whatever you want with.
The proxy service operation selection algorithm cannot determine the operation name from the request or returns an invalid operation (one which is not in the WSDL or null). Possible reasons include the following:
An error occurs while computing the operation.
The operation selection algorithm returns null.
The operation selection algorithm returns an operation that is not of the of the operations declared by the WSDL.
Source

wso2 ESB request is truncated

i'm using fresh installation of wso2 esb 4.8.1 with stanalone default configuration.
when i send soap request to my backend (perl service with soap lite), the body of POST request is truncated like this according to tcpdump:
SOAPAction: ""
Content-Type: text/xml
Content-Length: 511
Host: 192.168.11.234:8181
Connection: Keep-Alive
User-Agent: Synapse-PT-HttpComponents-NIO
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="htt
p://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<deleteAccountForHost xmlns="AbcdeHostingPhysicalHostManagerCPanelService">
<host xsi:type="xsd:string">zs000.abcde.net</host>
<user xsi:type="xsd:string">tstauto</user>
</deleteAccountForHost>
</soap:Body>
</soap:Envel
You can see that closing tag '</soap:Envel' is truncated.
But when i enable SOAP-tracer the request body becomes valid.
i use PT transport. I tried to switch transport to the nhttp and this problem seems to be disappeared.
So the question is: how to configure PT transport to avoid such strange behavior?
UPD1:
it seems that the problem occurs only when set the property FORCE_HTTP_1.0 and transport is PT
I got the same problem, but I set DISABLE_CHUNKING.
After many tries I tested that disabling chunking or forcing HTTP 1.0 results in truncated request.
I use WSO2 ESB version 4.8.1, client is SoapUI 5.0.0 or SoapClient from PHP 5.5.11.
When I use "Try this service" in ESB, then request is not truncated.
After switching from HTTP PassThrough Transport to HTTP-NIO Transport service behind endpoint receives complete request, but then I can't download WSDL of tenant.

SoapUI endpoint error randomly

I don't understand something about SoapUI and his mockservice's behaviour.
I'm using the client of SoapUI (testcase) and a Java EE application with JAX-RPC.
My problem is :
when I'm trying to call any webservice, from my Java Client, or the testcase of SoapUI, the mockservice return a well message at first call, and the error below at the second call, with the same call or not.
But if I'm waiting, It works ...
So, I have enabled the option in SOAPui : "close HTTP connection after each SOAP request" and it works all the time...
So my question is :
"Is it a normal behaviour of the mockservice, and how to implement this with my java client ?"
Thank you all.
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>Missing operation for soapAction [] and body element [null] with SOAP Version [SOAP 1.1]</faultstring>
</soapenv:Fault>
OK,
I found a solution on the forum of SoapUI : http://www.soapui.org/forum/viewtopic.php?t=5648
It is when you have the settings flag "HTTP Settings/Logs wire content of all mock requests" set to true.
=> Uncheck the flag and it works fine!
Thanks a lot !
I had the same problem, using SoapUI 5.1.2 Pro.
After receiving first asynchronous response to the MockService, the MockService
stopped and could not receive any more responses for the request I sent.
The error message was:
Thu Jul 02 12:59:44 CEST 2015:ERROR:An error occurred [Missing operation for soapAction [XXXX] and body element [null] with SOAP Version [SOAP 1.1]], see error log for details
In SoapUI Settings:
File->Preferences->Http Settings: "Enable Mock HTTP log", uncheck box:
"Logs wire content of all mock requests".
Now I receive several asynchronous responses in a row, and give response back on them.
The same problem may happen when two mock services run with the same endpoint address (including port and path) on SoapUI.