User login

Dims

Using mysql with WSO2 WSAS

Step #1: After connecting to the server as root, you can add new accounts. The following statements use GRANT to set up two new accounts:

Need good Looking Annotated WSDL's and XSD's? Just use our xsl stylesheets

Would you like your wsdl and xsd's to look this good?

Annotated WSDL

Try clicking on these links to view the annotated wsdl and xsd in your own browser:

Can i use Axis2 to write a client for SalesForce API?

Yes. Just run WSDL2Java with the following Options (with the forthcoming Axis2 1.3 Final):

wsdl2java -Eofv -g -uw -u -uri enterprise.wsdl

Notes:

  • -Eofv : tells wsdl2java to be a little lax with the schema validation
  • -g : tells wsdl2java generate all the classes specified in the schema, since usually WSDL2Java with ADB databinding generates only those complextypes / elements that are actually used in the wsdl
  • -uw : Unwrap the parameters, makes it a little bit easier to write code
  • -u : Unpacks the databinding classes, since by default when generating clients WSDL2Java generates all data types in the same Stub class
  • -uri : location of the wsdl

 

How do i run WSDL2Java against a https:// wsdl?

If you run into a "No Trusted Certificate" error when you run wsdl2java and your wsdl is protected by SSL (starts with https://) then look here for a tip to get you going:

http://article.gmane.org/gmane.comp.apache.webservices.axis.user/58499 

How do i tell Axis2 *not* to change the port/ip address when i use the useOriginalwsdl parameter?

When the services.xml parameter useOriginalwsdl=true the WSDL soap:address location-parameter is changed to the host address. This becomes a problem when the host is behind a NATed firewall and the WSDL requesting client is coming from a public Internet address. It is confusing that even though the parameter useOriginalwsdl is set to true, Axis2 is still changing the content of the WSDL. There is one more setting that you can switch on to tell Axis2 to just serve the wsdl as it is. You can do this by setting the modifyUserWSDLPortAddress parameter to false as shown below:

<parameter name="useOrignalWSDL">true</parameter>  

How do i log all HTTP/HTTPS traffic from an Axis2 Client?

Axis2 uses Jakart Commons HTTPClient. So you can just use the Context / Wire logging facilities provided by HTTPClient. In example below i set up the Simple logger in an environment variable and use that when i run my client.

C:\TESTING> SET JAVA_OPTS-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.showdatetime=true -Dorg.apache.commons.logging.simplelog.log.httpclient.wire=debug -Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=debug
C:\TESTING> java %JAVA_OPTS% MyClient

And the output i got was as follows (munged a bit to protect the innocent):

Axis2's WSDL 2.0 HTTP Code generation (Take II) a.k.a Try Yahoo REST Search API using Axis2

Step #1: Download Axis2 1.2 and set AXIS2_HOME

Step#2: Run WSDL2Java against the WSDL2.0 document we have come up for Yahoo REST API (See attached YahooV2Search.WSDL) as shown below:

wsdl2java.bat -u -wv 2.0 -uri YahooV2Search.wsdl

Step #3: Write some code to execute the generated stub (see attached Main.java). Drop the Main.java into src directory.

Step #4: Run "ant jar.client", set up your classpath with all axis2 jars and the generated service client jar and execute it. Here's my run.

C:\axis2-1.2\samples\yahoo>java Main  

Axis2's WSDL 2.0 HTTP Code generation a.k.a Try Flickr API using Axis2

Step #1: Download Axis2 1.2 and set AXIS2_HOME

Step#2: Run WSDL2Java against the WSDL2.0 document we have come up for Flickr API as shown below:

wsdl2java.bat -u -wv 2.0 -uri http://wso2.org/repos/wso2/trunk/wsas/java/modules/samples/FlickrClient/wsdl/FlickrService.wsdl

Step #3: Write some code to execute the generated stub (see attached Main.java). Drop the Main.java into src directory.

Step #4: use http://idgettr.com/ to find the user id of your favorite flickr person. Example, Ken Coar's id is 88257575@N00