Help Needed compile, deploy Web Service with Annotations on Web Logic 9.2
Hi,
I am new web logic and need some help in compiling, creating deployment file i.e. war, ear on Web Logic 9.2. I have the following sample web service with annotations code code but need help in compiling, creating deployment file (war,ear), creating proxy for testing etc. How to compile and create deployment files in WebLogic 9.2. Any help is really appreciated.
package sample_ws;
import java.rmi.RemoteException;
import javax.jws.*;
import javax.jws.soap.SOAPBinding;
import org.w3c.dom.Document;
@WebService
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.BARE)
public class EchoService {
public EchoService() {
@WebMethod(action="echo")
@WebResult(targetNamespace="http://exa.org", name="echoResult")
public Document echo(@WebParam(targetNamespace = "http://exa.org",
name = "echoMsg")
Document doc) throws RemoteException{
return doc;
}Thanks
I am using Oracle Jdeveloper as an IDE and created a war file and deployed on Oracle App. Server it works fine. Now if I deploy the same war on Web Logic it gives me the following error:
java.lang.IllegalStateException: could not find schema type named {{http}//exa.org}>>echoResult
Errors were encountered while performing this operation. Here is the code I have:
package webservice2 ;
import java.rmi.RemoteException;
import javax.jws.*;
import javax.jws.soap.SOAPBinding;
import org.w3c.dom.Document;
@WebService
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.BARE)
public class EchoService {
public EchoService() {
@WebMethod(action="echo")
@WebResult(targetNamespace="http://exa.org", name="echoResult")
public Document echo(@WebParam(targetNamespace = "http://exa.org",
name = "echoMsg")
Document doc) throws RemoteException{
return doc;
}And here is the wsdl file I have:
<definitions
name="EchoServiceService"
targetNamespace="http://webservice2/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://webservice2/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:ns1="http://exa.org"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://exa.org" elementFormDefault="qualified"
xmlns:tns="http://exa.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/">
<element name="echoMsg" nillable="true">
<complexType>
<sequence>
<any/>
</sequence>
</complexType>
</element>
<element name="echoResult" nillable="true">
<complexType>
<sequence>
<any/>
</sequence>
</complexType>
</element>
</schema>
</types>
<message name="EchoServicePortType_echo">
<part name="echoMsg" element="ns1:echoMsg"/>
</message>
<message name="EchoServicePortType_echoResponse">
<part name="echoResult" element="ns1:echoResult"/>
</message>
<portType name="EchoService">
<operation name="echo">
<input message="tns:EchoServicePortType_echo"/>
<output message="tns:EchoServicePortType_echoResponse"/>
</operation>
</portType>
<binding name="EchoServiceSoapHttp" type="tns:EchoService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="echo">
<soap:operation soapAction="echo"/>
<input>
<soap:body use="literal" parts="echoMsg"/>
</input>
<output>
<soap:body use="literal" parts="echoResult"/>
</output>
</operation>
</binding>
<service name="EchoServiceService">
<port name="EchoServiceSoapHttpPort" binding="tns:EchoServiceSoapHttp">
<soap:address location="http://localhost:8888/EnableSrc-WebService2-context-root/EchoServiceSoapHttpPort"/>
</port>
</service>
</definitions>Any ideas what might be wrong.
Similar Messages
-
Compile build.xml with Ant for web service with annotations
Hi Friends,
I have a web service with annotations, using javax.annotation.PostConstruct, and javax.annotation.PreDestroy.
I have a build.xml to create a EAR for this web service.
When I run the ant task, the build complete successfully but the .war file cannot be deployed on the WLS server. Taking a closer look, I see that the required files such as, webservices.xml, weblogic.xml, weblogic-webservices.xml, Provision.wsdl files are not generated.
Following is the build.xml file:
<?xml version="1.0" encoding="windows-1252" ?>
<project default="jwsc">
<property file="build.properties"/>
<property name="weblogic.jar.classpath"
value="C:/bea_jDev/wlserver_10.3/server/lib"/>
<property name="oimclient.jar.classpath"
value="C:/_data/Project_Dc/OIM_jars" />
<property name="com.jar.classpath" value="C:/JDeveloper/mywork/Service_Test/lib" />
<taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask">
<classpath>
<path id="weblogic.classpath">
<pathelement path="WEBLOGIC_HOME"/>
<fileset dir="${weblogic.jar.classpath}">
<include name="**/*.jar"/>
</fileset>
</path>
</classpath>
</taskdef>
<target name="all" depends="clean,build-service,deploy"></target>
<target name="build-service">
<jwsc srcdir="${src.home}" destdir="ear_directory" >
<classpath>
<path id="oim.classpath">
<pathelement path="OIM_HOME"/>
<fileset dir="${oimclient.jar.classpath}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${com.jar.classpath}">
<include name="**/*.jar"/>
</fileset>
</path>
</classpath>
<jws file="${jws.home}" type="JAXWS" />
</jwsc>
</target>
<target name="deploy">
<!--add wldeploy task here -->
</target>
<target name="clean">
<delete dir="output" />
</target>
</project>
Can you please point out what else is to be done and where exactly am I going wrong in writing the build.xml file.
Let me know if some else information is required.This is what I get when I run the ant task:
Buildfile: C:\JDeveloper\mywork\ProvisioningService_Test2\Provision\resource\build.xml
build-service:
[jwsc] JWS: processing module /com/fox/provision/webservice/endpoint/impl/ProvisionEndPointImpl
[jwsc] Parsing source files
[jwsc] Parsing source files
[jwsc] 1 JWS files being processed for module /com/.../provision/webservice/endpoint/impl/ProvisionEndPointImpl
[jwsc] [JAM] Warning: failed to resolve class org.apache.xmlbeans.XmlObject
[jwsc] [JAM] Warning: failed to resolve class com.bea.xml.XmlObject
[jwsc] [JAM] Warning: failed to resolve class javax.xml.rpc.holders.Holder
[jwsc] JWS: C:\..\...\..\...\code\ProvisioningService\src\com\...\provision\webservice\endpoint\impl\..EndPointImpl.java Validated.
[jwsc] Processing 1 JAX-WS web services...
[jwsc] warning: Specified AnnotationProcessorFactory, 'com.sun.istack.ws.AnnotationProcessorFactoryImpl', not found on search path.
warning: No annotation processors found but annotations present.
2 warnings
[jwsc] Compiling 2 source files to C:\DOCUME~1\....\LOCALS~1\Temp\_lsgijm
[jwsc] Building jar: C:\..\...\..\...\code\ProvisioningService\src\com\...\provision\webservice\deploy\ear_directory\com\fox\provision\webservice\endpoint\impl\...EndPointImpl.war
[jwsc] Created JWS deployment outputFile: C:\..\...\..\...\code\ProvisioningService\src\com\...\provision\webservice\deploy\ear_directory\....\...\provision\webservice\endpoint\impl\..EndPointImpl.war
[jwsc] [EarFile] Application File : C:\..\...\..\...\code\ProvisioningService\src\com\.....\provision\webservice\deploy\ear_directory\META-INF\application.xml
[AntUtil.deleteDir] Deleting directory C:\DOCUME~1\....\LOCALS~1\Temp\_lsgijm
BUILD SUCCESSFUL
Total time: 7 seconds
Due to some limitations, I edited the path in the build.xml files.
Please let me know what can be done. Thanks.
Edited by: user9112073 on Nov 22, 2011 9:52 PM -
Deploy a web service with the deploy tool (J2EE)
Hi!
I want to deploy a web service with the Deploy Tool (J2EE 1.4).
(For info, I'm working on Win 2000.)
I have the following error when I'm trying to deploy:
distribute: C:\monHello2\monApp.ear
Deploy action running...
Deployment failed on target localhost:4848_server : Fatal Error from EJB Compiler -- jaxrpc compilation exception
!!! Operation Failed !!!
Someone can help me, please? What's the problem?
Other question: when I create the WAR file, I have to add : my interface class, my implementation class, my others java classes, my WSDL file and my mapping.xml file.
Should I add the .jar that is used by one of my class???? I think yes, but...
thank you and excuse me for my english... ;o)Only primitive types can be returned? Is thatcorrect????
true - for more details check out section 3.4.1.3 of
this book which is available for purchase or online
http://java.sun.com/blueprints/guidelines/designing_w
ebservices/I meant to say primitive type and "special POJOs" called "JAXRPC Value Types" - check out the reference I listed -
Need idea : Integration of CRM On Demand web services with Oracle SOA 10g
Hi Al,
Can anyone have any idea on integration of CRM on Demand Web service with Oracle SOA 10g specially BPEL 10g.
If you have any idea please share with us. Or if you know any good link on the same... please let me know.....
Thanks in advance
DebarshiAFAIK there is no such mapping available, however you may want to take a look at this Support Community thread that discusses the migration and even gives some samples.
Jani Rautiainen
Fusion Applications Developer Relations
https://blogs.oracle.com/fadevrel/ -
Web Service with Complex Results and Flex
I have created a Enterprise Java Bean that has one "test" method that returns a String[]. I have compiled, deployed and registered this bean in Sun's Application Server 8.1. I am using NetBeans 5.0 to develop this project.
I try to load this web service into Flex and I get a fault thrown: TypeError: Error #1034: Type Coercion failed: cannot convert []@29e5d06 to XMLList. I have set the returnType in Flex as "e4X.". Do I need to do this in my webservice.
Any help would be appreciated.HI Andrea,
I think with present netweaver developer studio , we can create Web services with end points as simple data types in java and the array of that simple data types.
not sure whether it support our own custom developed classes as end points.
just go through these links.
http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
from this we will get Restrictions for WS Endpoints.
Regards
Kishor Gopinathan -
Protecting a REST web service with Policy Agent
I have deployed a REST web service in Glassfish using Jersey Annotations. A UI in the same Glassfish instance is protected by a policy agent that forces users through a login page. I would like to protect the REST web service with BASIC Authentication using the same policy agent. Is this possible? Is there supporting documentation?
Hi Daniel,
When you publish a message through Rest, hope your Restful service will receive/process the posted message?
So
YourBizTalk -->(Post Message to)-->RestFulService
From the error message, "the published message could not be routed because no subscribers were found.", it seems like the this Restful service is a
wrapper (or service interface) for BizTalk at client end( where message has been posted thru Rest) and actual posted message is “processed” by BizTalk and the error "" is from BizTalk "after" Rest. This message says the message you posted
through rest is not found subscription at their end.
So
YourBizTalk -->(Post Message to)-->RestFulService -->Clients'BizTalk.
Here problem is at Clients'BizTalk as shown where the posted message to their BizTalk is not processed because no subscription has been found.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
Issue using web-service with forms9i
using web-service with forms9i
Hi
I have a setup of oracle9ias release 2 on solaris machine. I have made a web-service which is deployed on nt machine on weblogic server. I have made a call from my form (forms9i) to this web-service. When i try to use that web-service after deploying my form on solaris, it initializes the web-service and performs the action successfully. Now the problem is that my form also makes a call to report server to generate a report. The problem is when i initialize the web-service and uses its function it works but after that making a call to report server will fail. Also if i make a call to report server first, it generates the report and then i make call to the web-service, then that web-service fails to run. And in both cases, the forms application stops saying session has aborted.
Why cant i make call to both the things in one session of application? What could be the reason for that? Need help urgently.Sorry,
I didn't know that this was necessary to find a solution.
Here are the definition out of the WSDL File:
<xsd:complexType name="ZS_EQART_RANGE_LINE">
<xsd:sequence>
<xsd:element name="SIGN" type="tns:char1"/>
<xsd:element name="OPTION" type="tns:char2"/>
<xsd:element name="LOW" type="tns:char10"/>
<xsd:element name="HIGH" type="tns:char10"/>
</xsd:sequence>
</xsd:complexType>
Thanks for Help
Ron -
Issue with calling external web service with authentication details ...
Hi,
I am facing a deployment issue with Oracle ESB. I am trying to call an external Web Service with authentication from ESB SOAP Service. It is working fine with my local ESB version 10.1.3.3.0 Build PCBPEL_10.1.3.3.0_GENERIC_070615.0525; however it is getting an error at our development ESB version 10.1.3.3.1 Build PCBPEL_10.1.3.3.1_GENERIC_RELEASE.
I am getting following error.
An unhandled exception has been thrown in the ESB system. The exception reported is: "org.collaxa.thirdparty.apache.wsif.WSIFException: exception during SOAP invoke: Server was unable to process request. ---> Object reference not set to an instance of an object.; nested exception is: javax.xml.rpc.soap.SOAPFaultException: Server was unable to process request. ---> Object reference not set to an instance of an object. at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.populateFaultMessage(WSIFOperation_JaxRpc.java:3086) at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.invokeOperation(WSIFOperation_JaxRpc.java:1728) at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.invokeRequestResponseOperation(WSIFOperation_JaxRpc.java:1473) at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.executeRequestResponseOperation(WSIFOperation_JaxRpc.java:1196) at oracle.tip.esb.server.common.wsif.WSIFInvoker.executeOperation(WSIFInvoker.java:867) at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:770) at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:790) at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.nextService(OutboundAdapterService.java:208) at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.processBusinessEvent(OutboundAdapterService.java:127) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatchNonRoutingService(InitialEventDispatcher.java:118) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(InitialEventDispatcher.java:95) at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1424) at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:112) at oracle.tip.esb.server.service.EsbRouterSubscription.onBusinessEvent(EsbRouterSubscription.java:307) at oracle.tip.esb.server.dispatch.EventDispatcher.executeSubscription(EventDispat
Could one of you please help me out to understand why it is happining.
Thanks in advance.
Jyotirmoy.Hi Mahesh,
One you are missing is authentication token or credentials.
Please refer to the following articles.
http://www.cleverworkarounds.com/2014/02/05/tips-for-using-spd-workflows-to-talk-to-3rd-party-web-services/
A Series of articles related to Web Service in SPD Workflow
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 1
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 2
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 3
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 4
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 5
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 6
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 7
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 8
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 9
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 10
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 11
Trials or tribulation?
Inside SharePoint 2013 workflows–Part 12
Please don't forget to mark it answered, if your problem resolved or helpful -
Calling Reporting Services Web Service with jQuery possible?
Hi,
is it possible to call the Reporting Services Web Service with jQuery? If yes, can someone post me a small example?
Background:
My plan is to create a html with a form which is also uploaded then into the reportserver. I open this html later by clicking a link in a report (with gotoURL open.window). The report opens the html inclusive the overtaken of some additional parameters
(reportname, reportdescription). These parameters I will use in the html-form as defaultvalues for the corresponding input-text-fields. Now the user can make some changes (i.e. the decription). With a click on a button I will send the new description to
the Reporting Services Web Service by using the SetProperties method, closing the html-window and reload the report. Important is that I want to upload the html also into the reportserver itself.
I have already found how to consume a web service via jQuery but with the Reporting Services Web Service I did not get it running in my tests.
I have referenced to the following jQuery.js: http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
Here you can see my tests I made with the results:
$.ajax({
type: 'POST',
url: 'http://<..>/ReportServer/ReportService2010.asmx/ListChildren',
data: {'ItemPath':'/','Recursive':false},
complete: function(xData, status) {
$('p').html($(xData.responseXML).text()); // result
$("#divStatus").text( status ); // status }
I got a NULL response with Status success. But where are the items?
Another test which should response only one value was that:
$.ajax({
type: "POST",
contentType: "text/xml; charset=utf-8",
url: "http://<..>/ReportServer/ReportService2010.asmx/GetItemType",
data: {"Item":"/Development"}, // Development is a Folder in my Reportserver-Root
dataType: "xml",
success: function (msg) {
$("#divResult").html(msg.responseXML);
error: function (data, status, error) {
$("#divResult").html("WebSerivce unreachable<br> <br>" + data.responseXML + "<br> <br>(" + error + ")");
Here I got an [object Error]
And here my last test:
var soapMessage = '<?xml version="1.0" encoding="utf-8"?>\
<soap:Envelope \
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" \
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
xmlns:xsd="http://www.w3.org/2001/XMLSchema">\
<soap:Body>\
<GetItemType xmlns="http://www.microsoft.com/sql/ReportingServer">\
<ItemPath>/Development</ItemPath>\
</GetItemType>\
</soap:Body>\
</soap:Envelope>';
$.ajax({
type: "POST",
contentType: "text/xml; charset=utf-8",
url: http://<..>/ReportServer/ReportService2010.asmx?wsdl,
data: soapMessage,
dataType: "xml",
success: processSuccess,
error: processError
function processSuccess(data, status, req) {
if (status == "success")
$("#response").text($(req.responseXML).find("Type").text());
function processError(data, status, req) {
alert(req.responseText + " " + status);
Here I got an "Undefined error"
Can anyone help me?
Thanks
René IllnerHi Rene,
I have one vbscript class to call web services. May be if you need you can use it.
dim ws
set ws = new webservice
ws.url = "http://servername/ReportServer/ReportService2010.asmx"
ws.method = "MethodName"
ws.parameters.Add "Parameter1", "Param1 Desc.."
ws.parameters.Add "Parameter2","[email protected].."
ws.execute
set ws = nothing
'------web service calling class
class WebService
public Url
public Method
public Response
public Parameters
public function execute()
dim xmlhttp
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
xmlhttp.open "POST", Url & "/" & Method, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send Parameters.toString
response = xmlhttp.responseText
set xmlhttp = nothing
end function
Private Sub Class_Initialize()
Set Parameters = new wsParameters
End Sub
Private Sub Class_Terminate()
Set Parameters = Nothing
End Sub
End class
class wsParameters
public mCol
public function toString()
dim nItem
dim buffer
buffer = ""
for nItem = 1 to Count
buffer = buffer & Item(nItem).toString & "&"
next
if right(buffer,1)="&" then
buffer = left(buffer,len(buffer)-1)
end if
toString = buffer
end function
public sub Clear
set mcol = nothing
Set mCol = CreateObject("Scripting.Dictionary")
end sub
public sub Add(pKey,pValue)
dim newParameter
set newParameter = new wsParameter
newParameter.Key = pKey
newParameter.Value = pValue
mCol.Add mCol.count+1, newParameter
set newParameter = nothing
end sub
public function Item(nKey)
set Item=mCol.Item(nKey)
end function
public function ExistsXKey(pKey)
dim nItem
for nItem = 1 to mcol.count
if mCol.Item(nItem).key = pKey then
ExistsXKeyword = true
exit for
end if
next
end function
public sub Remove(nKey)
mCol.Remove(nKey)
end sub
public function Count()
Count=mCol.count
end function
Private Sub Class_Initialize()
Set mCol = CreateObject("Scripting.Dictionary")
End Sub
Private Sub Class_Terminate()
Set mCol = Nothing
End Sub
end class
class wsParameter
public Key
public Value
public function toString()
toString = Key & "=" & Value
end function
end class
Regards, RSingh -
Hi All,
I am new to Web services with JAXB in ECLIPS.
When I tried to unmarshal the XML file, I am getting the following exception.
javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"order"). Expected elements are <{http://webservices/}read>,<{http://webservices/}readResponse>
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent
xml , schema and java class are in follow.
Please help me to solve this issue.
Mohseni Rad.
----------------------------------po.xsd-----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="order" type="OrderType"/>
<xsd:complexType name="OrderType">
<xsd:sequence>
<xsd:element name="shipTo" type="xsd:string"/>
<xsd:element name="billTo" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
------------------------------------po.xml----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<order>
<shipTo>shipto</shipTo>
<billTo>billto</billTo>
</order>
------------------TestWS.java---------------------
import java.io.FileInputStream;
import java.io.IOException;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import wsclient.*;
public class TestWs {
public static void main(String[] args) {
try{
SecondWebServices webService = new SecondWebServicesService
.getSecondWebServicesPort();
JAXBContext jctx = JAXBContext.newInstance("wsclient");
Unmarshaller unmarshaller = jctx.createUnmarshaller();
FileInputStream fl = new FileInputStream( "etc//po.xml" );
JAXBElement<?> order = (JAXBElement<?>)unmarshaller.unmarshal( fl );
OrderType orderType = (OrderType)order.getValue();
webService.read( orderType);
}catch (JAXBException je) {
je.printStackTrace();
catch (IOException ioe) {
ioe.printStackTrace();
}Hi,
When you are using JAX-WS, there is a tool wsimport, with which you are going to generate the artifacts required to implement the web service.
When you pass the WSDL as a parameter to the wsimport tool, it will be create the required beans also(JAXB Objects).
So need of any other external implementation of JAXB when you are working with JAXWS
Thanks, -
Consuming web services with a java application
Hello,
I want to consume an ABAP generated web service with a stand-alone Java application. I am very new to this topic and need some hints how this functionality could be achieved.
How is the web service accessed by the Java application? What about security issues?
Thank you in advance for your replies! They will be appreciated.
Kindest regardsHi
See this Help and Examples
http://help.sap.com/saphelp_nw2004s/helpdata/en/e2/36a53dc1204c64e10000000a114084/frameset.htm
Kind Regards
Mukesh -
Calling web service with basic authentication from EP "unauthorized"
Hello,
I need to call a .NET web service with basic authentication on the IIS from my portal application (no http proxy between portal and IIS). But always I get the following exception:
<b>com.sap.engine. services.webservices.jaxm.soap.accessor. NestedSOAPException:
Problem in server response: [Unauthorized].</b>
I'm using the following code for calling the .NET web service:
<b>...</b><i>Licence_GetList lParameter = new Licence_GetList();
lParameter.setStatus(CEnvironment.TransformStatus_WebService(search));
ILicenceManager lLicMan = (ILicenceManager) PortalRuntime.getRuntimeResources().getService("LicenceManager");
ILicenceManager lLicManSecure = lLicMan.getSecurisedServiceConnection(request.getUser());
Licence_GetListResponse lGetListResponse = lLicManSecure.Licence_GetList(lParameter);</i><b>...</b>
I've also configured a http system in the portal system landscape using the following parameters:
<i>Authentication Method : Basic Authentication
Authentication Type : Server
User Mapping Type : admin,user</i>
The user mapping is also personalized for this system!
What's wrong? Please help! This is really urgent!
Kind Regards
Joerg LoechnerHello Renjith,
here is a small cutout of my "portapp.xml";
<services>
<service alias="LicenceManager" name="LicenceManager">
<service-config>
<property name="className" value="de.camelotidpro.
pct.xi.scm.webservice.LicenceManager"/>
<property name="startup" value="false"/>
<property name="WebEnable" value="false"/>
<property name="WebProxy" value="true"/>
<property name="SecurityZone" value="de.camelotidpro.
pct.xi.scm.webservice.LicenceManager/
DefaultSecurity"/>
</service-config>
<service-profile>
<property name="SystemAlias" value="LicMan_NET"/
</service-profile>
</service>
</services>
I'm using a http system created in the system landscape (alias LicMan_NET). But it seems that this system is not used by the web service call (No error, even if I delete this system!). The code used to call this web service can be found at the top of this threat...
Regards
Joerg Loechner -
Connect to Secure web service with certificate from SAP EP
Hi Experts,
Here is the current situation:
1. Our business requirement is to connect 3rd party RESTful web service which requires secure connection with private client certificate attached
2. I've tested in my Java test application and successfully attached private certificate to HttpsURLConection request to the web service and made a connection. No problem at all.
KeyStore keyStore = KeyStore.getInstance("PKCS12");
InputStream inputStream = new FileInputStream("privateKeyCert.p12");
keyStore.load(inputStream, "myPassword".toCharArray());
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyManagerFactory.init(keyStore, "myPassword".toCharArray());
KeyManager[] kms = keyManagerFactory.getKeyManagers();
SSLContext sslContext = SSLContext.getInstance("SSL");
sslContext.init(kms, null, new SecureRandom());
SSLSocketFactory sockFact = sslContext.getSocketFactory();
URL url = new URL("https://www.thirdpartywebservice.com/testroot/");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setSSLSocketFactory(sockFact);
conn.setRequestMethod("POST");
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setUseCaches(false);
conn.setDefaultUseCaches (false);
conn.setRequestProperty("Content-Type", "text/xml");
3. Next, I tried to apply my Java application to SAP EP NetWeaver, and found that I have to use SecureConnectionFactory:
https://help.sap.com/saphelp_nw70ehp1/helpdata/en/e2/71c83edf72e16be10000000a114084/content.htm
4. So, I modified my Java code for SAP EP:
KeyStore keyStore = KeyStore.getInstance("PKCS12");
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("privateKeyCert.p12");
keyStore.load(inputStream, "myPassword".toCharArray());
SecureConnectionFactory scFactory = new SecureConnectionFactory(keyStore);
HttpURLConnection conn = scFactory.createURLConnection("https://www.thirdpartywebservice.com/testroot/");
conn.setRequestMethod("POST");
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setUseCaches(false);
conn.setDefaultUseCaches (false);
conn.setRequestProperty("Content-Type", "text/xml");
And I'm facing the following error message:
Exception: java.security.UnrecoverableKeyException: ja
va.security.GeneralSecurityException: Unable to decrypt private key: javax.crypto.BadPaddingException: Invalid PKCS#5 padding length: 253
Could you please help me what this error message means?
Do you think do I need to to do some other configuration to make connection to web service with client certificate?
This is our first approach. Please help...
Thank you in advance.SunJSSE implement SSL server CertificateRequest in a strict mode, if client failed to find a proper certificate corresponding the server request, it does not guess what's the proper certificate and send to the server. In your case, because there is no intermediate certificate in the client context, so there is no way to make the decision which certificate would be acceptable by server, so client does not send any cert to server. That's why you got a handshaking error.
I guess your client key store does not contains a full certificate path from the client end-entity certificate to the root CA. Please import the full certificate path into the key store.
BTW, these approaches should work, but I found no reason why one does not adopt #1:
1. import the full certification path of client certificate into client key store.
2. as a workaround, configure the server to send a list including the intermediate certificates;
3. as a workaround, you will have to customize the client KeyManager if you don't want to or are not able to configure the server to send a list including the intermediate certificates. -
Has anyone tried accessing a web service with eclipse? We'd like to start using them with our forms for database lookups and the web services are already written. We just haven't had much success calling them with our servlets.
Thanks,
ChadWe also wrote web services with eclipse and deployed them in our jboss app.serv. We can call them in our pdf forms as data connection, or inside some events with java script code.
What is your problem about ? Did you manage to deploy the web services ? Can you create data connections inside forms ?
We have faced some difficulties to success writing and caling web services. I may help if you have similar problems. -
Accessing external web service with non-constant URL
Hello, all
I am looking in the documentation on accessing external web services, but either I am looking in the wrong place, or the documentatoin is lacking info.
My clients have several web services in the local network (regular services, not DB-based), the have the same interface, but different URL's.
Versions of the DB are 11, 12, and 16.
First of all, I do not see in the specs an option for a non-hardcoded URL. The logic says that this has to be possible, but I cannot find it.
Second, I need to see an example of accessing an XML or JSon based service, I cannot find it in the specs either.
Can anyone point me to a document with examples?
Thank you
ArcadyThe following will call a web service with whatever URL you pass in as the argument "myurl". I think that is what you are looking for.
CREATE PROCEDURE cli_test2( myurl LONG VARCHAR )
RESULT( httpheaders long varchar, httpvalues long varchars
URL '!myurl'
To deal with the resulting data in XML, use the OPENXML() function.
eg. To turn an XML list of employees that looks like this:
<root>
<row EmployeeID="102" Surname="Whitney" GivenName="Fran" StartDate="1984-08-28"/>
</root>
into a table of results, you would do this (where xmlgetemplist() is the web service call):
CREATE OR REPLACE PROCEDURE xmlgetemplist() RESULT( httpheader long varchar, httpbody long varchar)
URL 'http://localhost/demo/xmlEmployeeList'
TYPE 'HTTP:GET';
create variable res long varchar;
-- call the web service
select httpbody into res from xmlgetemplist() where httpheader = 'Body'
-- extract the XML elements into a SQL result set
select * from openXML( res, '/root/row' ) WITH ( EmployeeID INT '@EmployeeID',
GivenName CHAR(20) '@GivenName',
Surname CHAR(20) '@Surname',
PhoneNumber CHAR(10) '@Phone');
To deal with the resulting data in JSON, use the sp_parse_json() procedure.
eg.
To turn a JSON formatted list of employees that looks like this:
"EmployeeID": 102,
"Surname": "Whitney",
"GivenName": "Fran",
"StartDate": "1984-08-28",
"TerminationDate": null
into a table of results, you would do this (where jsongetemplist() is the web service call):
CREATE OR REPLACE PROCEDURE jsongetemplist() RESULT( httpheader long varchar, httpbody long varchar)
URL 'http://localhost/demo/jsonEmployeeList'
TYPE 'HTTP:GET';
create variable foo long varchar;
--call the webservice
select httpbody into foo from jsongetemplist() where httpheader = 'Body';
--turn the json result into a structured array of data
-- this step is required because of less structured nature of JSON
call sp_parse_json( 'output_array', foo);
--extract the JSON elements from the output array into a SQL result set
SELECT output_array[[row_num]].EmployeeID as EmployeeID,
output_array[[row_num]].SurName as SurName,
output_array[[row_num]].GivenName as GivenName,
output_array[[row_num]].StartDate as StartDate,
output_array[[row_num]].TerminationDate as EndDate
FROM sa_rowgenerator(1, CARDINALITY(output_array))
Hope this helps,
--Jason
Maybe you are looking for
-
Displaying Document Name With The Summary in a Single Column Using Document Library View.
Hi All, I have a question that relates to SharePoint Document Library Views. I want to view the Documents name with the summary in a single column. Below image shows an example of it. I need this within a SharePoint Document Library. Also I want the
-
Multiple Operations in a Single Interface - How To trace the Operations !!!
Hello PI Experts, We have implemented an interface for Multiple Operations in the client proxy. We are able to trigger the proxy for the diff methods of the class and the message is flowing to the desired Receiver correctly. I have 2 queries regardin
-
Hi All, I have a requirement to upload document from the application server to the DMS. We have a standard BAPI available for creating a document in DMS i.e. BAPI_DOCUMENT_CREATE2 but I am not able to attach application server file along with this.
-
How can I move from the text body to the inspector in voiceover - need to change spacing
I want to get to the inspector (for formatting text in Pages), but cannot seem to find the correct keystrokes. After marking text, I would like to double space (or go from double spacing back to single spacing).
-
How to Call Function Module from XI Mapping
Hi All, I would like to call a function module that resides in ECC through XI mapping. Can any one please through some light on how to proceed ? Regards