I was trying to deploy a back-end web service to IBM Message Broker. Then create a Java client to call Broker, which in turn calls the back-end web service.
If the Java client can call Broker, then so can any other Java app.
The IBM documentation on the subject is massive. So here are the steps that I took, plus a couple of issues I struggled with, and then resolved.
Two useful links:
Setting up a flow:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fad64230_.htm
Deploying a flow:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Faa40160_.htm
Create a new Application.
Within the Application, create a new Message Flow.
On the flow workspace, on the left menu column, select Web Services.
Select a SOAPInput, SOAPRequest, SOAPReply.
Connect the input to the request, and the output of the request to the reply.
When you double-click on the Request, it will be looking for a WSDL. Select import/create new at the bottom of the window. On the next window, select the bottom option to select a WSDL from outside the environment. Paste in the entire URL to your back-end web service.
Click next and finish on the following windows to get back to the Flow work space.
One point that I struggled with and was not obvious in the documentation, is that you will need to create a new flow for each method in your back-end web service.
In the SOAPRequest properties, set the "binding operation" to the method behind that flow.
Once you build and deploy the bar, you can right-click anywhere on the Flow work space and select Test...
The test tool will display the WSDL of the web service that is deployed to your Broker instance. You can grab that WSDL and use Ant or Maven to create a Java client and call your web service (which in turn calls the back-end service)
That's not strictly speaking true, you can route to a label based on the operation name in the wsdl or even use the SOAPInput node in generic gateway mode. Generally you'll want a flow per "service" not per method.
Related
I am new in the area of SOAP Based web services. I am using TomEE server. The server is a bit customized according to my organization's need.
Few days back, when I was trying to run the web services example from TomEE website, I was able to generate the wsdl and calling the web service by a client.
Now, when I need to use the customized version of TomEE plus (by the organization), I can see that the request does reach to the server and hence there is a log entry also but my #WebMethod is not getting executed.
Does any one has any idea about any configuration which can prevent the request from reaching to the webservice method? Is there any pointer around how can I debug further to reach out to the root cause of this issue?
Without further information about what is customized it's like fishing in the dark.
I would guess that perhaps the global web.xml or the server.xml of tomee server is changed so that some URI context mappings are not forwarded or ignored. But it's only a lucky tip.
I imported a service reference to a SOAP web service from the customer and coded my client based on that.
After going to production, they said they will launch a new version of the web service with changes to the output type of one of the requests I make to the service (among new messages that I don't consume).
I know I can update my service reference and update my client code to process the updated wsdl and launch an update to my client at the same time the web service updates.
But, is it possible to instrument the WCF code in some way so that I can handle both versions of the response without having to coordinate the update of my client with the update of the web service?
In most cases, NO. It depends on what has changes in the service interface? In most cases you'll need (and want) to upgrade your client. You can always ask them to support more versions of their interfaces.
Working on a project where I need to consume a web service over HTTPS (SSL) using Domino 8.0.2.
Was able to create the script library to consume the web service.
Created a simple button to test consuming it with this code:
Use "AA-FEED"
Sub Click(Source As Button)
Dim ws1 As New IAccountService_n1
Dim r1 As New ArrayOfValidSystem_n2
Set r1 = ws1.GetValidSystemsList()
End Sub
When called, Notes prompts for me to Cross Certify with your server, which I do.
That is to be expected.
Click on 'Cross Certify" button and then the web service is contacted and returns an error message:
"The Web Service IAccountService_n1 method GetValidSystemsList has returned a fault."
So...
The provider of the web serivce says when it is consumed in Java, they add certifier information to the soap header.
Not sure if the Cross Certify actions in Lotus would do equlivent in LotusScript.
If the WebService requires authentication, in your generated web service consumer code, add the following after the webservice initialize call:
Sub NEW
Call Service.Initialize ("UrnDefaultNamespaceWSQueryService", ...
'ADD THE FOLLOWING
'set userid and password if required
Call Service.SetCredentials("userid","password")
'set SSL options
Call Service.SetSSLOptions(NOTES_SSL_ACCEPT_SITE_CERTS + NOTES_SSL_ACCEPT_EXPIRED_CERTS)
Web services in LotusScript has a Java component to it when communicating (uses AXIS).
It might be that you have to put the certificate into the CACERTS. The following wiki article explains this.
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Connecting_to_a_Domino_server_over_SSL_in_Java_using_a_self_signed_certificate._
I apologize in advance if the question is ridiculous.
I have an asmx service running in Azure (HTTP - no SSL).
I have a WPF app that loads a X509Certificate2 and adds it to the request by doing the following:
X509Certificate2 cert = new X509Certificate2("...");
webRequest.ClientCertificates.Add(cert);
In the web service I get the certificate by
new X509Certificate2(this.Context.Request.ClientCertificate.Certificate)
And then I load a cert (that I have both uploaded to the Azure control panel and added to my service definition file) by using the following sample:
var store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
X509Certificate2Collection certs = store.Certificates.Find(X509FindType.FindBySubjectName, certName, true);
And then I validate by doing the following:
clientCert.Thumbprint == certs[0].Thumbprint
Now unfortunately I get an exception (System.Security.Cryptography.CryptographicException: m_safeCertContext is an invalid handle) as soon as I do
Request.ClientCertificate.Certificate
So I have a few questions. How do I avoid the exception. This answer states I need to modify an IIS setting, but how can I do that in Azure?
In any case is this even the proper way to do certificate authentication?
Thanks!
You can use command scripts to modify IIS, in combination with appcmd.exe.
For a quick example (disabling timeout in an application pool), take a look at this sample by Steve Marx.
In this example, you'd call DisableTimeout.cmd as a startup task. For more info on creating startup tasks, you can watch this episode of Cloud Cover Show. There should be a lab on startup tasks in the Platform Training Kit as well.
Just remember that any type of IIS configuration change should be made via an automated task at startup. If you manually change IIS via RDP, those changes won't propagate to all of your instances, and won't remain persistent in the event of hardware failure or OS update.
You can remote into your azure instances to manage IIS. As for a way to do it globally for all instances at once, I'm not sure. That would be an interesting side project though.
http://learn.iis.net/page.aspx/979/managing-iis-on-windows-azure-via-remote-desktop/
Right now i'm developing a composite application using Open ESB. I got my
application tested through a test case by sending a request SOAP message,
and it works great.
The problem is, i want my composite application to be able to be used like
a webservice so i could call the composite application from Python using SOAPpy,
not by sending an edited SOAP message like in the test case.
How can i achieve that? Should i invoke the BPEL process from a webservice?
I already read "A Gentle Introduction: Exploring OpenESB" and "Building SOA-Based
Composite Applications Using NetBeans IDE 6". Both of the books create an interface
for the composite application, not using the composite application like a webservice.
Thanks in advance,
Well, by definition, each BPEL process is rendered as a Web service. In other words: the only possibility to invoke a BPEL process is to invoke the web service interface provided by the BPEL process (the myRole of the partnerlink that is used for inbound message activties). When your test case also submits a SOAP message to the BPEL process, any other Web service client can do the same.
Sorry for late answer but this can help other users.
Of course they will not use the composite applications as web service simply because it - the composite app - is a client consuming the web service that you have defined using the BPEL ( Business Process Execution LANGUAGE ).
Now the question is, how to get the wsdl for our web service ?
Answer :
go to your composite application
select " wsdl ports " select the wsdl that you have created in "BPEL MODEL" project.
right click => properties => location , then copy location value
replace {httpdefaultport} by 9080
add ?wsdl to the end of the location