Jboss fuse- running route with cxf endpoint in local camel context - jbossfuse

I am working on a fuse project in Jbds. I am running a route as local camel context. It has cxf endpoint(soap), route started and started listening at /order/. If anyone has experience running camel context with cxf end point locally in the jbds, would you please let me know how to send soap message to this route which running in local camel context in jbds?

Are you looking to invoke webservice from java (client)?
you can use Service.create to create Service instances, the following code illustrates this process:
import java.net.URL;
import javax.xml.ws.Service;
URL wsdlURL = new URL("http://localhost/hello?wsdl");
QName SERVICE_NAME = new QName("http://apache.org/hello_world_soap_http", "SOAPService");
Service service = Service.create(wsdlURL, SERVICE_NAME);
Greeter client = service.getPort(Greeter.class);
For More info refer apache cxf documentation [1]
[1]http://cxf.apache.org/docs/how-do-i-develop-a-client.html

Please follow the steps to test the SOAP service exposed. The steps details are mentioned in the image link.Image for the steps to be taken.
See all the services exposed by CXF service (SOAP).
See the WSDL for the services exposed by CXF (SOAP).
Open SOAPUI and create new SOAP project.
Enter the details i.e WSDL URL in project detail.
The project will be displayed on the left-hand side.
Open the request in SOAPUI.
Fill the request and hit the green submit button.

Related

What is the function of http://macbook-pro.local:7001/weblogic/?

I found that weblogic defaults to a context "/weblogic/", there is nothing in this page, what does this do?enter image description here
When you hit /weblogic, you hit the ReadyApp monitoring servlet under /weblogic/ready context.
In short, this servelet exposes the status of your applications deployed in your application server.
Http code 200 means that your server and your app are started and ready to handle incoming requests.
You can read details about the ReadyApp framework in this documentation.

XDS.b testing with SoapUI

I have to implement a simple client to a XDS.b server (SubmitObjectRequest and RetrieveDocumentSetRequest operations), but I'm struggling to get even a simple example of use to work.
I've tried using Mirth Connect's Channel for XDS.b also, but with no use. I even tried to copy its SOAP envelope to use with SoapUI. Didn't work.
I'm using HIEOS deployed on Glassfish as my XDS.b server.
I'm lost and confused. Could anyone give me a guidance on how to make this work?
If the HIEOS is deployed correctly within the Glassfish the service endpoint provides a wsdl definition where the interface is specified. Check the Glassfish for the wsdl of the service.
http://localhost:8080/my-ws/simple?WSDL
Quelle: docs.oracle.com/cd/E18930_01/html/821-2418/gbiyw.html
The list of provided endpoints you can see here:
https://kenai.com/projects/hieos/pages/WebServices
So to retrieve the wsdl you should use for example:
http://localhost:8080/axis2/services/xdsrepositoryb?wsdl
which applies for the ProvideAndRegisterDocumentSet-b transaction of the XDS Repository actor.
You can use the WSDL definition to create a WS request using SOAP UI at first.
SOAP UI creates a request based upon the wsdl definition which can be used to
test a against your XDS repo.
When you know how a SOAP request must be constructed you can try it using Mirth or
create your own client using Apache CXF http://cxf.apache.org/ for example.
Or you use AXIS2 to create a client from the WSDL. Of course does Visual Studio and C# also offer mechanisms to create a WS client directly from a WSDL definition.

Axis2 web service conversion to Apache CXF web service

Hi I am not too familiar with web services in general but, I am trying to re-create an old Axis2 generated web service using Apache Camel and Apache CXF.
In the old service, the SOAP body had the following shape:
<chi:processAMessage soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<A xsi:type="xsd:string">A message</A>
<Code xsi:type="xsd:string">ABC</Code>
<Complete xsi:type="xsd:boolean">true</Complete>
</chi:processAMessage>
To re-create the old web service using CXF, I am following the Apache CXF example 'camel-example-cxf-tomcat'. In this example, SOAP bodies have the following shape:
<ns1:reportIncident xmlns:ns1="http://incident.cxf.example.camel.apache.org/">
<arg0>
<details>blah blah</details>
<email>davsclaus#apache.org</email>
<familyName>Smith</familyName>
<givenName>Bob</givenName>
<incidentDate>2011-11-25</incidentDate>
<incidentId>123</incidentId>
<phone>123-456-7890</phone>
<summary>blah blah summary</summary>
</arg0>
</ns1:reportIncident>
As I understand the CXF example, the node <reportIncident> is interpreted as the service's operation name, and <arg0> is interpreted as the service message's InputReportIncident bean.
How can I write my web service using CXF so that it interprets the SOAP body's root element as the service message's bean itself and therefore assuming a default operation name (as it is not included in the SOAP body)? Is this possible at all and, are there any examples that I can follow where all SOAP messages route to a common service operation name?
Thanks in advance,
PM.

Built in HTTP Server in Apache CXF

Is there an built in HTTP server in Apache CXF like "HttpServerFactory" of Jersey?
I tried reading through the CXF documentation but couldn't find anything similar.
Yes, there is.
If you want JAX-RS service deployed on built-in server use org.apache.cxf.jaxrs.JAXRSServerFactoryBean. Example usage (taken from CXF samples):
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(CustomerService.class);
sf.setResourceProvider(CustomerService.class,
new SingletonResourceProvider(new CustomerService()));
sf.setAddress("http://localhost:9000/");
sf.create();
If you want JAX-WS service deployed on built-in server you can use javax.xml.ws.Endpoint.publish(..). Sample code (again copied from CXF Sample):
HelloWorldImpl implementor = new HelloWorldImpl();
String address = "http://localhost:9000/helloWorld";
Endpoint.publish(address, implementor);
Both JAX-WS and JAX-RS require adding org.apache.cxf:cxf-rt-transports-http-jetty to classpath.
I really recommend taking look at CXF samples. Sometimes they are indispensable.

Calling GWT RPC service

I have been going through the google tutorial ( which I find very good ) at
https://developers.google.com/web-toolkit/doc/latest/tutorial/RPC
I have the service up and running on my local server and my JavaScript client can call it fine. OK so far. Now, what I want to do is deploy the service on a remote server JoeSoapHost:8080
How do I now tell my client where to send it's requests? I can't see any server/url being created in my RPC call. It just works by magic but now I want to get under the bonnet and start breaking it.
[Edit}
This is the Interface my client uses to know what service on the Server is to be called. I know that my Web.xml web descriptor must have a url that matches this. It has this because my server is invoked ok. Problem is, if I now decide to deploy my server elsewhere how do I tell my client what server/domain name to use?
#RemoteServiceRelativePath("stockPrices")
public interface StockPriceService extends RemoteService
{
StockPrice[] getPrices(String[] symbols);
}
What I want to achieve first is have a simple GWT client calling into an RPC service. I have this working but only when the server is localhost.
Next step, I deploy my app to the Google App Engine. What must I change now because my RPC service in my JavaScript is not being called when I deploy my app to
http://stockwatcherjf.appspot.com/StockWatcher.html
1) Brian Slesinsky excellent document on RPC - https://docs.google.com/document/d/1eG0YocsYYbNAtivkLtcaiEE5IOF5u4LUol8-LL0TIKU/edit#heading=h.amx1ddpv5q4m
2) #RemoteServiceRelativePath("stockPrices") allows GWT code to determine relative to your host/server/domain i.e http//mydomain.com/gwtapp/stockPrices
3) You can search GOOGle IO Sessions from 2009 - 2012 for some more in depth stuff on GWT RPC usage.
#RemoteServiceRelativePath gives the path of the servlet relative to the GWT.getModuleBaseURL() (which is more or less the URL of the *.nocache.js script); it doesn't "just work by magic".
If you deploy your services on a different server than the one serving your client code, then you'll likely hit the Same Origin Policy. CORS can help here, but you'll lose compatibility with IE (up to IE9 included). You'd better stick serving everything from the same origin.