Calling GOS attachment service
Dear experts,
I need to call the GOS method for attaching documents to an object from my ABAP pgm. I use the method CL_GOS_VIEW_MANAGER->START_SERVICE_DIRECT with the service 'CREATE_ATTA'. Before that I have created an object referring to CL_GOS_MANAGER and sent to it the table of services containing one single entry 'CREATE_ATTA'.
The method START_SERVICE_DIRECT returns with the exception EXECUTION_FAILED and SY-MSGxx containing the message "The service <''> is not available" (SGOS_MSG 001).
What am I missing? Why the service name CREATE_ATTA doesn't find its way to GOS?
TIA
Raf
Rafael,
For the Office 2007 there are some changes needed, I did a follow-up post on that:
http://friendlyabaper.blogspot.com/2009/12/office-2007-and-secret-handshake.html
As I recall, we also had to implement an OSS note (the Office 2007 attachments didn't work correctly even in SO01), but you might already have it through the support pack. Be sure to test if SO01 works with Office 2007 attachments.
I'm not sure about the plain text issue... I remember when debugging the binary data does look like a Japanese text on screen, so could this have something to do with the text conversion to binary? How are you reading the file and passing the data to FM? You might need to use just text (ASCII) instead of binary. Our primary goal was to attach Office/PDF files. I thought I tested the code with .TXT as well, but I might be wrong.
I've never tested this with Excel files that had pictures. If plain Excel opens fine, I suspect it's not an issue with the program but with SAP/Excel transformation in general. Try it in SO01 and see what happens. Hint: if you open attachment, the file gets written into your local SAPWorkDir folder. You can open it and examine there. This helped me a lot in my research.
Good luck!
Similar Messages
-
How to call GOS(Generic Object service) attachment ( BMP file ) into SAP
How to call GOS(Generic Object service) attachment ( BMP file ) into SAP script
Example: MM02 Service object there attaching the bmp file the same file i need to call script based on the material number
Please provide the procedure and coding.
Thanks in advance
RajuHi,
The following link may be useful to u.
help.sap.com/printdocu/.../BCSRVOBS.pdf -
Services for Object (GOS) Attachement List not showing after attachment
Hi All,
I have created a new entry for the Generic Object Service List and this links to a copy of the CL_GOS_SRV_ATTACHMENT_CREATE class (Create attachment) with some additional logic. However, after attaching a file, the "Attachment List" does not become available until after I re-enter the transaction. The attachment list is showing the correct attachments.
After some (understatement...) investigation, I found that even if I try and link the new service to a unchanged copy of the CL_GOS_SRV_ATTACHMENT_CREATE service in SGOSATTR, it is not working. It is attaching fine, but the "Attachment List" entry in the Services for Object Menu is still greyed out. If I attach the original class CL_GOS_SRV_ATTACHMENT_CREATE to the newly created entry it works fine. e.g. straight after I attach a file to the transaction, the menu entry becomes available.
I can't find where the re-draw of the GOS menu happens and hence can not determine what is going wrong. Does anybody know if this is part of the Kernel or is this actually done in ABAP ?
Am I missing something ? Debugging including system debugging for two days now and can't find it... very frustrating.
Any help would be appreciated.
Thanks,
Wouter.Hi Wouter,
I had originally posted to ask if you had resolved this since I was facing the same issue, but then deleted my post when I was able to get it working. Sorry, I didn't mean to initiate a flurry of activity in such an old thread.
My scenario is I created a new GOS service entry in table SGOSATTR using transaction SGOSM. My new service uploads attachments to an external document management system via a call to a RESTful web service. The class I use in the SGOSM entry is a custom subclass of CL_GOS_SRV_URL_CREATE.
I resolved this issue by taking a look at what CL_GOS_SRV_URL_CREATE does in its EXECUTE method. The key bits to refresh the GOS Attachment List with the new attachment are...
raise event commit_required. " if SGOSM has the commit flag checked
raise event service_succeeded
exporting eo_service = me.
These events tell any subscribers to go do their thing-- which in this case includes a refresh of the GOS Attachment List. So in the EXECUTE method of my custom subclass, after I call function BINARY_RELATION_CREATE, I raise these events...
CALL FUNCTION 'BINARY_RELATION_CREATE'
EXPORTING
obj_rolea = gs_object
obj_roleb = rel_doc
relationtype = 'URL'
EXCEPTIONS
OTHERS = 1.
CASE sy-subrc.
WHEN 0.
MESSAGE s043(sgos_msg). " The attachment was successfully created
RAISE EVENT commit_required.
RAISE EVENT service_succeeded
EXPORTING eo_service = me.
WHEN OTHERS.
MESSAGE s042(sgos_msg). " The attachment has not been created
ENDCASE.
I hope this is helpful to you even though your initial implementation was a while back. Thanks for replying to my question though!!
Cheers,
Amy -
How Can I call a UCM service from SOAP request
Hi,
I have created one custom service and I would like to call that service from 3rd Party system via SOAP call. The 3rd Party system does not have the capability to call through RIDC.
Now I have exposed my service and tried to call but authentication exception was coming status code 401.
So I created one sample ADF application and tried to call the DocInfo service for testing (I thought let's try DocInfo then I will check my custom service). I downloaded the DocInfo service from UCM and uploaded the WSDL into the project and got the client DocInfoSoapClient.java file.
public class DocInfoSoapClient
@WebServiceRef
private static DocInfo docInfo;
public static void main(String [] args)
docInfo = new DocInfo();
DocInfoSoap docInfoSoap = docInfo.getDocInfoSoap();
DocInfoByNameResult res = docInfoSoap.docInfoByName("TEST_001603", null);
System.out.println(res.getContentInfo());
// Add your code to call the desired methods.
The error is coming like:
Exception in thread "main" com.sun.xml.ws.client.ClientTransportAccessException: The server sent HTTP status code 401: Unauthorized: http://xxxxxxxx:16200/_dav/cs/idcplg
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.getClientTransportException(HttpTransportPipe.java:340)
I tried a lot but same error. There should be some process by which I can send the userid and password but failed. Even I tried to send the properties as key value pair in IdcPropertyList but I know that is wrong.
I checked the Issue: https://community.oracle.com/thread/2424460
But there was no answer.
Can anyone help on it?
Regards,
SantanuHi Santanu,
You need to write SoapHandler in order to pass username and pwd. You will need 2 classes namely HeaderHandlerResolver & SoapHandler. This is how i do in in my JAX-WS clients. I generate stubs and then attach handler to webserviceinterface
PFA HeaderHandlerResolver.java and SoapHandler.java you would attach soap handler something like this in your code i have never done this via ADF so not sure.
HeaderHandlerResolver soapHandlerResolver = new HeaderHandlerResolver();
docInfo.setHandlerResolver(soapHandlerResolver);
In SoapHandler class you will mention username and pwd like this
soapMessageContext.put(BindingProvider.USERNAME_PROPERTY,"username");
soapMessageContext.put(BindingProvider.PASSWORD_PROPERTY,"pwd");
Regards,
Amol Gavali -
Error while calling ejb service call from BPM service
Hi,
We are using the Oracle 11.1.1.5.0
We are calling ejb service call from BPM service to update the data to Oracle database.
We are getting the below error when we executing the ejb service call from BPM Service.
<Error> <EJB> <BEA-010026> <Exception occurred du
ring commit of transaction Name=[EJB oracle.bpm.bpmn.engine.ejb.impl.BPMNDeliver
yBean.handleCallback(java.lang.String,java.lang.String,java.lang.String,int,bool
ean)],Xid=BEA1-45B91984D57960994897(30845116),Status=Rolled back. [Reason=javax.
transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a p
articipant in two-phase commit. To force this participation, set the GlobalTrans
actionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhas
eCommit for the Data Source = EBSConnection],numRepliesOwedMe=0,numRepliesOwedOt
hers=0,seconds since begin=1,seconds left=60,XAServerResourceInfo[SOADataSource_
base_domain]=(ServerResourceInfo[SOADataSource_base_domain]=(state=rolledback,as
signed=soa_server1),xar=SOADataSource,re-Registered = false),XAServerResourceInf
o[ArCnTaskForms@EBSConnection@EBSConnection_base_domain]=(ServerResourceInfo[ArC
nTaskForms@EBSConnection@EBSConnection_base_domain]=(state=rolledback,assigned=s
oa_server1),xar=weblogic.jdbc.wrapper.JTSEmulateXAResourceImpl@fa5476,re-Registe
red = false),SCInfo[base_domain+soa_server1]=(state=rolledback),properties=({web
logic.jdbc.remote.EBSConnection=t3://192.168.10.114:8001, weblogic.transaction.n
ame=[EJB oracle.bpm.bpmn.engine.ejb.impl.BPMNDeliveryBean.handleCallback(java.la
ng.String,java.lang.String,java.lang.String,int,boolean)]}),local properties=({w
eblogic.jdbc.jta.SOADataSource=[ No XAConnection is attached to this TxInfo ]}),
OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=soa
server1+192.168.10.114:8001+basedomain+t3+, XAResources={eis/tibjms/Queue, eis
/activemq/Queue, WLStore_base_domain_BPMJMSFileStore, WLStore_base_domain__WLS_s
oa_server1, eis/fioranomq/Topic, eis/jbossmq/Queue, eis/Apps/Apps, eis/websphere
mq/Queue, eis/AQ/aqSample, WLStore_base_domain_SOAJMSFileStore, eis/aqjms/Queue,
WSATGatewayRM_soa_server1_base_domain, eis/sunmq/Queue, eis/pramati/Queue, SSCo
nnectionDS_base_domain, eis/tibjms/Topic, eis/tibjmsDirect/Queue, eis/wls/Queue,
eis/tibjmsDirect/Topic, EDNDataSource_base_domain, eis/wls/Topic, eis/aqjms/Top
ic, RL3TST_base_domain, ArCnTaskForms@EBSConnection@EBSConnection_base_domain, S
OADataSource_base_domain, WLStore_base_domain_UMSJMSFileStore_auto_2},NonXAResou
rces={})],CoordinatorURL=soa_server1+192.168.10.114:8001+base_domain+t3+): weblo
gic.transaction.RollbackException: Could not prepare resource 'ArCnTaskForms@EBS
Connection@EBSConnection_base_domain
JDBC driver does not support XA, hence cannot be a participant in two-phase comm
it. To force this participation, set the GlobalTransactionsProtocol attribute to
LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source
= EBSConnection
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(
TransactionImpl.java:1881)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(Se
rverTransactionImpl.java:345)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
sactionImpl.java:239)
at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocal
Object.java:622)
at weblogic.ejb.container.internal.BaseLocalObject.__WL_postInvokeTxRetr
y(BaseLocalObject.java:455)
at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(Sess
ionLocalMethodInvoker.java:52)
at oracle.bpm.bpmn.engine.ejb.impl.BPMNDeliveryBean_of8dk6_ICubeDelivery
LocalBeanImpl.handleCallback(Unknown Source)
at com.collaxa.cube.engine.dispatch.message.instance.CallbackDeliveryMes
sageHandler.handle(CallbackDeliveryMessageHandler.java:47)
at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(Dispatc
hHelper.java:140)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.process(BaseDispatc
hTask.java:88)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTas
k.java:64)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.transaction.xa.XAException: JDBC driver does not support XA, he
nce cannot be a participant in two-phase commit. To force this participation, se
t the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended)
or EmulateTwoPhaseCommit for the Data Source = EBSConnection
at weblogic.jdbc.wrapper.JTSXAResourceImpl.prepare(JTSXAResourceImpl.jav
a:83)
at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
sourceInfo.java:1327)
at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
sourceInfo.java:513)
at weblogic.transaction.internal.ServerSCInfo$1.run(ServerSCInfo.java:36
8)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTunin
gWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
.>
<12 Oct, 2012 12:34:40 PM IST> <Error> <oracle.soa.bpel.engine.dispatch> <BEA-00
0000> <failed to handle message
javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot
be a participant in two-phase commit. To force this participation, set the Globa
lTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateT
woPhaseCommit for the Data Source = EBSConnection
at weblogic.jdbc.wrapper.JTSXAResourceImpl.prepare(JTSXAResourceImpl.jav
a:83)
at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
sourceInfo.java:1327)
at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
sourceInfo.java:513)
at weblogic.transaction.internal.ServerSCInfo$1.run(ServerSCInfo.java:36
8)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTunin
gWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
>
<12 Oct, 2012 12:34:40 PM IST> <Error> <oracle.soa.bpel.engine.dispatch> <BEA-00
0000> <Failed to handle dispatch message ... exception ORABPEL-05002
Message handle error.
error while attempting to process the message "com.collaxa.cube.engine.dispatch.
message.instance.CallbackDeliveryMessage"; the reported exception is: Error comm
itting transaction:; nested exception is: javax.transaction.xa.XAException: JDBC
driver does not support XA, hence cannot be a participant in two-phase commit.
To force this participation, set the GlobalTransactionsProtocol attribute to Log
gingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = EB
SConnection
This error contained an exception thrown by the message handler.
Check the exception trace in the log (with logging level set to debug mode).
ORABPEL-05002
Message handle error.
error while attempting to process the message "com.collaxa.cube.engine.dispatch.
message.instance.CallbackDeliveryMessage"; the reported exception is: Error comm
itting transaction:; nested exception is: javax.transaction.xa.XAException: JDBC
driver does not support XA, hence cannot be a participant in two-phase commit.
To force this participation, set the GlobalTransactionsProtocol attribute to Log
gingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = EB
SConnection
This error contained an exception thrown by the message handler.
Check the exception trace in the log (with logging level set to debug mode).
at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(Dispatc
hHelper.java:207)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.process(BaseDispatc
hTask.java:88)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTas
k.java:64)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:662)
>
Could any body help on this issue.It is little bit urgent for us to resolve.
Thanks in advance.Thanks Sudipto Desmukh,
The link is helpful me to resolve this issue.
Thanks,
Narasimha E -
Help needed in calling a Web service
Hi,
I want to call a web service from my component. The called web service might have different names, therefore I don't want to use the proxy class way.
I am facing problem in parsing the input parameters from the wsdl file. I have attached the wsdl file at the end.
I am using the javax.wsdl.xml.WSDLReader(axis). I have been able to parse all the bindings, ports and messages but
1. i am not able to parse the wsdl:types to obtain the input parameters
//javax.wsdl.Operation op obtained from the port which alternatively obtained from Definition
Message inputs = op.getInput().getMessage();
Part part = null;
// let's find the input params
Map inputParts = inputs.getParts();
// create the object array which Axis will use to pass in the parameters
inputParams = new Object[inputParts.size()];
s = inputParts.keySet();
it = s.iterator();
int i = 0;
while(it.hasNext())
part = (Part) inputParts.get(it.next());
Afetr performing this, i have no clue as to how to parse the input parameters.
2. How will i generate the java Objects array from these input parameters to pass to the Call.invoke function, i.e.
Call call = (Call) service.createCall();
call.setOperation(portQN, operationName);
Object ret = (Integer) call.invoke(inputParams);
The function takes an object[] as input but since i have complex types involved in wsdl, so how will this object array needs to be populated
WSDL file:
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://V4_0.testcenter8" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax258="http://testcenter8.V4_0.testcenter8/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax257="http://V4_0.testcenter8/xsd" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://V4_0.testcenter8">
<wsdl:types>
<xs:schema xmlns:ax260="http://V4_0.testcenter8/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://V4_0.testcenter8">
<xs:import namespace="http://V4_0.testcenter8/xsd" />
<xs:element name="executeRuleset">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="param0" nillable="true" type="ax257:testcenter8_V4_0_Req" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="executeRulesetResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="ax257:testcenter8_V4_0_Resp" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema xmlns:ax259="http://testcenter8.V4_0.testcenter8/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://V4_0.testcenter8/xsd">
<xs:import namespace="http://testcenter8.V4_0.testcenter8/xsd" />
<xs:complexType name="testcenter8_V4_0_Req">
<xs:sequence>
<xs:element minOccurs="0" name="cabinetName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="inputsobj" nillable="true" type="ax258:Inputs" />
<xs:element minOccurs="0" name="loginReqd" type="xs:boolean" />
<xs:element minOccurs="0" name="outputsobj" nillable="true" type="ax258:Outputs" />
<xs:element minOccurs="0" name="password" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="userName" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="testcenter8_V4_0_Resp">
<xs:sequence>
<xs:element minOccurs="0" name="inputsobj" nillable="true" type="ax258:Inputs" />
<xs:element minOccurs="0" name="outputsobj" nillable="true" type="ax258:Outputs" />
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://testcenter8.V4_0.testcenter8/xsd">
<xs:complexType name="Inputs">
<xs:sequence>
<xs:element minOccurs="0" name="description" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="subject" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Outputs">
<xs:sequence>
<xs:element minOccurs="0" name="category" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="massRequestType" type="xs:int" />
<xs:element minOccurs="0" name="subCategory" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="executeRulesetRequest">
<wsdl:part name="parameters" element="ns:executeRuleset" />
</wsdl:message>
<wsdl:message name="executeRulesetResponse">
<wsdl:part name="parameters" element="ns:executeRulesetResponse" />
</wsdl:message>
<wsdl:portType name="testcenter8_V4_0WebServicePortType">
<wsdl:operation name="executeRuleset">
<wsdl:input message="ns:executeRulesetRequest" wsaw:Action="urn:executeRuleset" />
<wsdl:output message="ns:executeRulesetResponse" wsaw:Action="urn:executeRulesetResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="testcenter8_V4_0WebServiceSoap11Binding" type="ns:testcenter8_V4_0WebServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="executeRuleset">
<soap:operation soapAction="urn:executeRuleset" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="testcenter8_V4_0WebServiceSoap12Binding" type="ns:testcenter8_V4_0WebServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="executeRuleset">
<soap12:operation soapAction="urn:executeRuleset" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="testcenter8_V4_0WebServiceHttpBinding" type="ns:testcenter8_V4_0WebServicePortType">
<http:binding verb="POST" />
<wsdl:operation name="executeRuleset">
<http:operation location="testcenter8_V4_0WebService/executeRuleset" />
<wsdl:input>
<mime:content type="text/xml" part="executeRuleset" />
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="executeRuleset" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="testcenter8_V4_0WebService">
<wsdl:port name="testcenter8_V4_0WebServiceHttpSoap11Endpoint" binding="ns:testcenter8_V4_0WebServiceSoap11Binding">
<soap:address location="http://192.168.56.89:8080/axis2/services/testcenter8_V4_0WebService.testcenter8_V4_0WebServiceHttpSoap11Endpoint/" />
</wsdl:port>
<wsdl:port name="testcenter8_V4_0WebServiceHttpSoap12Endpoint" binding="ns:testcenter8_V4_0WebServiceSoap12Binding">
<soap12:address location="http://192.168.56.89:8080/axis2/services/testcenter8_V4_0WebService.testcenter8_V4_0WebServiceHttpSoap12Endpoint/" />
</wsdl:port>
<wsdl:port name="testcenter8_V4_0WebServiceHttpEndpoint" binding="ns:testcenter8_V4_0WebServiceHttpBinding">
<http:address location="http://192.168.56.89:8080/axis2/services/testcenter8_V4_0WebService.testcenter8_V4_0WebServiceHttpEndpoint/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Regards
NitinAn update -
I want to call a web service from my component. The called web service might have different names, therefore I don't want to use the proxy class way.
I am parsing the WSDL file and obtaining the different parameters. But i am having problem in passing the parameters(receiving as well) to the web service and i am not able to find any good refernce on the internet, i am getting the following exception:
org.xml.sax.SAXException: Invalid element in javax.xml.rpc.namespace.QName - inputsobj
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(Unknown Source)
at org.apache.axis.AxisFault.makeFault(Unknown Source)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(Unknown Source)
at org.apache.axis.message.SAX2EventRecorder.replay(Unknown Source)
at org.apache.axis.message.MessageElement.publishToHandler(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at org.apache.axis.message.RPCElement.deserialize(Unknown Source)
at org.apache.axis.message.RPCElement.getParams(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at javaapplication17.Invoke.axisInvoke(Invoke.java:639)
at javaapplication17.Invoke.parseWSDL(Invoke.java:423)
at javaapplication17.Invoke.run(Invoke.java:76)
at javaapplication17.Invoke.main(Invoke.java:64)
at org.apache.axis.client.Call.invoke(Unknown Source)
Error invoking service : org.xml.sax.SAXException: Invalid element in javax.xml.rpc.namespace.QName - inputsobj
at javaapplication17.Invoke.axisInvoke(Invoke.java:639)
at javaapplication17.Invoke.parseWSDL(Invoke.java:423)
at javaapplication17.Invoke.run(Invoke.java:76)
at javaapplication17.Invoke.main(Invoke.java:64)
Caused by: org.xml.sax.SAXException: Invalid element in javax.xml.rpc.namespace.QName - inputsobj
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(Unknown Source)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(Unknown Source)
at org.apache.axis.message.SAX2EventRecorder.replay(Unknown Source)
at org.apache.axis.message.MessageElement.publishToHandler(Unknown Source)
at org.apache.axis.message.RPCElement.deserialize(Unknown Source)
at org.apache.axis.message.RPCElement.getParams(Unknown Source)
... 7 more
Following is the code snippet and the passed values to the function:
Parameters passed to the test function:
targetNamespace = "http://V5_0.testcenter8"
serviceName = "testcenter8_V5_0WebServiceHttpSoap11Endpoint"
portName = "http://V5_0.testcenter8:testcenter8_V5_0WebService"
operationName = "executeRuleset"
arrListParameters; //obtained by parsing the XSD using XMLSchema(XSD created from wsdl types tag)
implURI = "http://192.168.56.89:8080/axis2/services/testcenter8_V5_0WebService?wsdl"
test function:
NOTE:some things have been hardcoded.
public void axisInvoke(String targetNamespace, String serviceName, String portName,
String operationName, ArrayList<Parameter> arrListParameters, String implURI)
try
// first, due to a funny Axis idiosyncracy we must strip portName of
// it's target namespace so we can pass it in as targetNamespace, localPart
int index = portName.indexOf(":", portName.indexOf("http://") + new String("http://").length());
String portNamespace = portName.substring(0, index);
portName = portName.substring(index == 0 ? index : index + 1); // to strip the :
javax.xml.rpc.namespace.QName serviceQN = new javax.xml.rpc.namespace.QName(portNamespace, portName);
org.apache.axis.client.Service service = new org.apache.axis.client.Service(new URL(implURI), serviceQN);
javax.xml.rpc.namespace.QName portQN = new javax.xml.rpc.namespace.QName(targetNamespace, serviceName);
// This Call object will be used the invocation
Call call = (Call) service.createCall();
// Now make the call...
System.out.println("Invoking service >> " + serviceName + " <<...");
//call.setOperation(portQN, operationName); //do not work
call.setOperationName(new javax.xml.rpc.namespace.QName("http://V5_0.testcenter8", "executeRuleset"));
call.removeAllParameters();// why there is parameters already added to the list of parameters
//call.addParameter(new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), org.apache.axis.Constants.XSD_STRING, ParameterMode.PARAM_MODE_INOUT);
ArrayList<Object> arrListInputParameters = new ArrayList<Object>();
for(int i = 0; i < arrListParameters.size(); i++)
String strParamName = arrListParameters.get(i).strParamName;
String strParamType = arrListParameters.get(i).strParamType;
String strNameSpaceURI = arrListParameters.get(i).strParamNameSpaceURI;
if(strNameSpaceURI.compareToIgnoreCase("http://www.w3.org/2001/XMLSchema") == 0)
boolean isInParam = true;
if(strParamName.compareToIgnoreCase("cabinetName") == 0)
call.addParameter(new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), org.apache.axis.Constants.XSD_STRING, ParameterMode.PARAM_MODE_INOUT);
arrListInputParameters.add("testcenter8");
else if(strParamName.compareToIgnoreCase("loginReqd") == 0)
call.addParameter(new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), org.apache.axis.Constants.XSD_BOOLEAN, ParameterMode.PARAM_MODE_INOUT);
arrListInputParameters.add(false);
else if(strParamName.compareToIgnoreCase("password") == 0)
call.addParameter(new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), org.apache.axis.Constants.XSD_STRING, ParameterMode.PARAM_MODE_INOUT);
arrListInputParameters.add("D@nger0us");
else if(strParamName.compareToIgnoreCase("userName") == 0)
call.addParameter(new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), org.apache.axis.Constants.XSD_STRING, ParameterMode.PARAM_MODE_INOUT);
arrListInputParameters.add("sanjeev");
else if(strParamName.compareToIgnoreCase("description") == 0)
call.addParameter(new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), org.apache.axis.Constants.XSD_STRING, ParameterMode.PARAM_MODE_INOUT);
arrListInputParameters.add("Change Address");
else if(strParamName.compareToIgnoreCase("subject") == 0)
call.addParameter(new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), org.apache.axis.Constants.XSD_STRING, ParameterMode.PARAM_MODE_INOUT);
arrListInputParameters.add("Credit Card");
else if(strParamName.compareToIgnoreCase("category") == 0)
call.addParameter(new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), org.apache.axis.Constants.XSD_STRING, ParameterMode.PARAM_MODE_INOUT);
arrListInputParameters.add("");
isInParam = false;
else if(strParamName.compareToIgnoreCase("massRequestType") == 0)
call.addParameter(new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), org.apache.axis.Constants.XSD_INTEGER, ParameterMode.PARAM_MODE_INOUT);
arrListInputParameters.add((int) 1);
isInParam = false;
else
call.addParameter(new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), org.apache.axis.Constants.XSD_STRING, ParameterMode.PARAM_MODE_INOUT);
arrListInputParameters.add("");
isInParam = false;
/*if(isInParam)
call.addParameter(strParamName, org.apache.axis.Constants.XSD_STRING, ParameterMode.PARAM_MODE_INOUT);
//call.addParameter(strParamName, new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), ParameterMode.PARAM_MODE_INOUT);
else
call.addParameter(strParamName, new javax.xml.rpc.namespace.QName(strNameSpaceURI, strParamName), ParameterMode.PARAM_MODE_INOUT);
/*inputParams = new Object[arrListInputParameters.size() + 1];
inputParams[0] = "";
for(int i = 1; i <= arrListInputParameters.size(); i++)
inputParams[i] = arrListInputParameters.get(i - 1);
inputParams = new Object[arrListInputParameters.size()];
for(int i = 0; i < arrListInputParameters.size(); i++)
inputParams[i] = arrListInputParameters.get(i);
call.setReturnType(org.apache.axis.Constants.XSD_QNAME);
//call.setReturnType(org.apache.axis.Constants.XSD_ANYTYPE);
call.setTargetEndpointAddress(new URL("http://192.168.56.89:8080/axis2/services/testcenter8_V5_0WebService.testcenter8_V5_0WebServiceHttpSoap11Endpoint"));
Object ret = call.invoke(inputParams);
System.out.println("Result returned from call to " + serviceName + " -- " + ret);
System.out.println("Finished");
catch(java.net.MalformedURLException e)
System.out.println("Error invoking service : " + e);
e.printStackTrace();
catch(javax.xml.rpc.ServiceException e2)
System.out.println("Error invoking service : " + e2);
e2.printStackTrace();
catch(java.rmi.RemoteException e3)
System.out.println("Error invoking service : " + e3);
e3.printStackTrace();
WSDL file:
WSDL file:
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://V4_0.testcenter8" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax258="http://testcenter8.V4_0.testcenter8/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax257="http://V4_0.testcenter8/xsd" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://V4_0.testcenter8">
<wsdl:types>
<xs:schema xmlns:ax260="http://V4_0.testcenter8/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://V4_0.testcenter8">
<xs:import namespace="http://V4_0.testcenter8/xsd" />
<xs:element name="executeRuleset">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="param0" nillable="true" type="ax257:testcenter8_V4_0_Req" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="executeRulesetResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="ax257:testcenter8_V4_0_Resp" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema xmlns:ax259="http://testcenter8.V4_0.testcenter8/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://V4_0.testcenter8/xsd">
<xs:import namespace="http://testcenter8.V4_0.testcenter8/xsd" />
<xs:complexType name="testcenter8_V4_0_Req">
<xs:sequence>
<xs:element minOccurs="0" name="cabinetName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="inputsobj" nillable="true" type="ax258:Inputs" />
<xs:element minOccurs="0" name="loginReqd" type="xs:boolean" />
<xs:element minOccurs="0" name="outputsobj" nillable="true" type="ax258:Outputs" />
<xs:element minOccurs="0" name="password" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="userName" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="testcenter8_V4_0_Resp">
<xs:sequence>
<xs:element minOccurs="0" name="inputsobj" nillable="true" type="ax258:Inputs" />
<xs:element minOccurs="0" name="outputsobj" nillable="true" type="ax258:Outputs" />
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://testcenter8.V4_0.testcenter8/xsd">
<xs:complexType name="Inputs">
<xs:sequence>
<xs:element minOccurs="0" name="description" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="subject" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Outputs">
<xs:sequence>
<xs:element minOccurs="0" name="category" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="massRequestType" type="xs:int" />
<xs:element minOccurs="0" name="subCategory" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="executeRulesetRequest">
<wsdl:part name="parameters" element="ns:executeRuleset" />
</wsdl:message>
<wsdl:message name="executeRulesetResponse">
<wsdl:part name="parameters" element="ns:executeRulesetResponse" />
</wsdl:message>
<wsdl:portType name="testcenter8_V4_0WebServicePortType">
<wsdl:operation name="executeRuleset">
<wsdl:input message="ns:executeRulesetRequest" wsaw:Action="urn:executeRuleset" />
<wsdl:output message="ns:executeRulesetResponse" wsaw:Action="urn:executeRulesetResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="testcenter8_V4_0WebServiceSoap11Binding" type="ns:testcenter8_V4_0WebServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="executeRuleset">
<soap:operation soapAction="urn:executeRuleset" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="testcenter8_V4_0WebServiceSoap12Binding" type="ns:testcenter8_V4_0WebServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="executeRuleset">
<soap12:operation soapAction="urn:executeRuleset" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="testcenter8_V4_0WebServiceHttpBinding" type="ns:testcenter8_V4_0WebServicePortType">
<http:binding verb="POST" />
<wsdl:operation name="executeRuleset">
<http:operation location="testcenter8_V4_0WebService/executeRuleset" />
<wsdl:input>
<mime:content type="text/xml" part="executeRuleset" />
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="executeRuleset" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="testcenter8_V4_0WebService">
<wsdl:port name="testcenter8_V4_0WebServiceHttpSoap11Endpoint" binding="ns:testcenter8_V4_0WebServiceSoap11Binding">
<soap:address location="http://192.168.56.89:8080/axis2/services/testcenter8_V4_0WebService.testcenter8_V4_0WebServiceHttpSoap11Endpoint/" />
</wsdl:port>
<wsdl:port name="testcenter8_V4_0WebServiceHttpSoap12Endpoint" binding="ns:testcenter8_V4_0WebServiceSoap12Binding">
<soap12:address location="http://192.168.56.89:8080/axis2/services/testcenter8_V4_0WebService.testcenter8_V4_0WebServiceHttpSoap12Endpoint/" />
</wsdl:port>
<wsdl:port name="testcenter8_V4_0WebServiceHttpEndpoint" binding="ns:testcenter8_V4_0WebServiceHttpBinding">
<http:address location="http://192.168.56.89:8080/axis2/services/testcenter8_V4_0WebService.testcenter8_V4_0WebServiceHttpEndpoint/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions> -
Calling SharePoint Web Services from PL/SQL
We are trying to call SharePoint Web Services with UTL_DBWS or UTL_HTTP. We are able to call some test web services, but when it comes to using SharePoint services, we keep getting 401 errors..even when we use set_authorization.
Has anyone been able to use UTL_DBWS or UTL_HTTP to call SharePoint web services? If so, can you point us in the right direction?
ThanksAB,
I didn't realize you cannot attach documents to your post. You will have to provide me with an email address that I can send the documents to. They are a little rough (ie not commented etc) but they do illustrate the point. The basic idea is to build up the payload of the soap envelope using pl/sql. Meaning as I loop through the cursor I use each record in the cursor to build an xml string. This string of xml becomes the payload of the soap message. This could also be done using xml functionality provided by the db meaning xmlelement, xmlforest etc. The issue I ran into was the size of the message. That is why I elected to build the xml message by string concatenation as I moved through the cursor.
Ryan -
How to transfer GOS attachment to my work item
Hi Friends,
I have the following requirement. The user while creating a Appropriation request in tcode IMA1N will create an attachment using Generic Object Services(GOS). once he saves my workflow will trigger and it will go to approval. I need to show the attachment created using GOS in my Work item. How to achieve this. Please advice.I have some annotations:
The object type ARCHIVE is for archived Data Files from the DataArchiving. The object type for ArchiveLink documents is IMAGE
The default method is .Display to display the document.
The GOS-Attachment is not a SAP ArchiveLink document. This attachment is stored in SOOD and linked via the GOS-relationship table SRGBTBREL
The business object, that can be used here is: SOFM
The object instance needs to be found with a custom self-made background method, to find the correct link and create an object instance.
After that, this instance can be used as a secondary method in the work item's execution or attached to the ADHOCOBJECTS as already mentioned here.
Good luck,
Florin
P.S.: Similar reply cross-posted to SAP-WUG -
Guys, looking for your help.
My issue is, we have a Custom Transaction for PR. We have implemented the GOS functionality for the screen.
We are able to attach documents and save the same to KPRO ( SAP Office).
Documents are fine and sitting pretty there.
Problem is when i leave the transaction and comeback again to the same document, the 'Attachment list' link in the GOS menu is grayed out. where in the attachments are saved in the Content repository.
Any solution to this issue would be highly appreciated.
Thanks
Vinodh BalakrishnanHi,
I think you are using OO for this functionality. then
select * from sgosattr where name ne 'VIEW_ATTA'
and name ne 'PCATTA_CREA'.
i_service-sign = 'E'.
i_service-option = c_eq.
i_service-low = sgosattr-name.
append i_service to i_services.
endselect.
* then call gos manager
if v_tmode eq 'C'. " Create or Change Mode
i_borident-objtype = 'Y_ATTA'.
i_borident-objkey = yhdr-docno.
create object gos_manager
exporting
is_object = i_borident
it_service_selection = i_services
ip_no_commit = ' '
exceptions
object_invalid = 1.
else. " Display Mode
i_borident-objtype = 'Y_ATTA'.
i_borident-objkey = yhdr-docno.
create object gos_manager
exporting
is_object = i_borident
it_service_selection = i_services
ip_mode = 'D'
exceptions
object_invalid = 1.
endif.
aRs -
Transfer GOS Attachment (Single/Multiple) from custom program to XK01
Hi,
GOS - Generic Object Service is a way one can attach single / multiple attachment. I have a custom program where there is a GOS with some attachment (used CL_GOS_MANAGER class).
Next I need to send / transfer this GOS attachment from my custom program to say a standard transaction , eg XK01.
Whether we can achieve this functionality, ie. we are able to create/save attachment but is there a way to send attachment (not via email) such that the same attach itself to the GOS of the standard transaction. I don't see any method in the CL_GOS_MANAGER class by which we can achieve this!
Any suggestion/solution will be highly appreciated!
Thanks,
DebHi,
I am trying to send attachment linked to a custom BO to standard BO eg, LFA1 using 'GOS_SERV_TOOLS_TEST' (copy_linked_objects).
Surprisingly, I am able to copy/send attachment list within same BO (LFA1) from one LIFNR to another LIFNR. But the same method does not work when I try to copy attachment between diff BO example from VENDOR BO to MATERIAL BO. Why is it so?
Also it does not work between a custom BO & standard BO. Please suggest in case I am missing on anything!
Thank,
Deb -
Call MTOM web service using pl/sql (utl_http)
Hi All,
Is anyone able to call a MTOM web service using utl_http from pl/sql ?
A typical request looks like this:
--uuid:fd1fbed8-7042-4673-a304-becc1ffb037f+id=1
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body>......</s:Body></s:Envelope>
uuid:fd1fbed8-7042-4673-a304-becc1ffb037f+id=1
A microsoft C# tool is provided to generate some requests and using fiddler I can see the content type is in the header as well as in the request. In the requests it doesn't contain the UID. Connection is set to keep-alive, is that possible using pl/sql ?
The part that builds the header looks like:
l_http_request := UTL_HTTP.begin_request(url => 'http://' || l_host_name || ':' || l_port || '/CRUDService.svc', method => 'POST', http_version => 'HTTP/1.1');
UTL_HTTP.set_header(l_http_request, 'Host', l_host_name || ':' || l_port);
UTL_HTTP.set_header(l_http_request, 'SOAPAction', '"action"');
UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_string_request));
UTL_HTTP.set_header(l_http_request, 'Content-ID', '<http://tempuri.org/0>');
UTL_HTTP.set_header(l_http_request, 'Content-Transfer-Encoding', '8bit');
UTL_HTTP.set_header(l_http_request, 'Content-Type', 'multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:fd1fbed8-7042-4673-a304-becc1ffb037f+id=1";start-info="text/xml"');
I've played with the request by adding or removing information, the http response is (400) "Bad Request - Invalid Header", so should be somewhere in the header? Anyone ideas?
Kind regards,
MichielHI Michiel
I am also trying to achieve something similar to that. I am trying to call a web service that sends an xml attachment over MTOM? Kindly, let me know if this was achievable from your end? I mean how did the issue got resolved.
thanks
vijay -
Example for calling document type service using a XML
Hi,
Can anybody give me some pointers to any examples about Document type webservice
that is passed an XML document? The service expects a custom java object.
I am running WLS 7.0 with sp2.
This is what i have done so far:
I have created a document type web-service with the following signature
public CustomReturnObject provideService(customParameter) { }
The 'customParameter' is based on a "CustomParameter.xsd" and 'CustomReturnObject'
is based on its schema. I ran the "autotype" to generate the java classes for
the schema.
Now, we would like to invoke the service by passing an XML document instead of
calling it by creating instances of "CustomParameter" java class. Also we would
like to get the XML represented by "CustomReturnObject" in the client program
instead of the java object.
Can anybody help?
Thanks
RaghuThe latest version of WLS is 8.1.
I think the the "endpoint" needs to be string.
String endpoint =
http://RASUBR-2K:7001/SubscriptionServicesWS/SSApplicationService.jws;
Regards,
-manoj.
http://manojc.com
"Raghu Subramaniam" <[email protected]> wrote in message
news:[email protected]...
>
SAAJ did work!
But it is not working with the BEA client libraries (WLS 8.0 Beta). I amgetting
the following exception
exception ejava.lang.IllegalArgumentException: endpoint shou
ld be String or URL
java.lang.IllegalArgumentException: endpoint should be String or URL
atweblogic.webservice.core.soap.SOAPConnectionImpl.call(SOAPConnectionI
mpl.java:43)
at TestMain.main(TestMain.java:51)
Attached is my test file.
I used the libraries from Sun's web services kit and it works.
Is it a known problem? Any fixes?
Raghu
"manoj cheenath" <[email protected]> wrote:
SAAJ will work. You can also use DII client with
generic type mapping. Check this out:
http://manojc.com/tutorial/sample27/Main.java
Regards,
-manoj
http://manojc.com
"Raghu Subramaniam" <[email protected]> wrote in message
news:[email protected]...
But how did you call the web service. Did you use the stubs in yourclient
code?
We don't want to use the stubs generated from "clientgen". Rather wantto
call
the service by passing a XML string that adheres to our schema expectedby
our
service. Our service is document-style.
I am trying to use the SAAJ api to generate a SOAPMessage and callthe
service.
Anybody has tried this before. Does it work?
Raghu
"Mike DeAngelo" <[email protected]> wrote:
I just did this the first time a few weeks ago, but I had some
gotchas...
>>>>
First, run the autotype ant task against your xsd file to generateyour
value
objects (I think you already did this).
Second, write your java class or EJB to use the value objects asparameter/return
type. (I think you did this too.) If you are going to invoke anEJB,
create
the EJB-Jar file.
Third, use the servicegen ant task to create the an ear file. Theear
file will
contain both the ejb-jar and file webservice.war which is generatedby
weblogic.
Fourth, unbundle the ear file, then unbundle the war file. Edit the
file WEB-INF/web-service.xml
Add the contents of your original xsd under the <types> element (iftypes
doesn't
exist, it should be the first subelement under the root element).Add
the contents
of types.xml (generated by autotype) to the <type-mapping> element(It
should
be the second element under the root element.
Rebundle the war file, rebundle the ear file, and deploy it.
Here is a fragment of the ant stuff...
<taskdef name="servicegen"
classname="weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask"/>
<target name="check-servicegen" depends="stage">
<uptodate property="servicegen.notRequired"
targetfile="${stage}/my_webservice.ear"
srcfile="${stage}/my_ejb.jar">
</uptodate>
</target>
<target name="servicegen"
depends="check-servicegen"
unless="servicegen.notRequired">
<servicegen destEar="${stage}/my_webservice.ear"
warName="my_webservice.war">
<classpath refid="compile.classpath"/>
<service ejbJar="${stage}/my_ejb.jar"
targetNamespace="http://foo/bar/baz"
serviceName="process"
serviceURI="/process"
generateTypes="False"
expandMethods="True"
style="document">
</service>
</servicegen>
</target>
Mike
"Raghu Subramaniam" <[email protected]> wrote:
Hi,
Can anybody give me some pointers to any examples about Document
type
webservice
that is passed an XML document? The service expects a custom javaobject.
I am running WLS 7.0 with sp2.
This is what i have done so far:
I have created a document type web-service with the following
signature
>>>>>
public CustomReturnObject provideService(customParameter) { }
The 'customParameter' is based on a "CustomParameter.xsd" and'CustomReturnObject'
is based on its schema. I ran the "autotype" to generate the javaclasses
for
the schema.
Now, we would like to invoke the service by passing an XML documentinstead
of
calling it by creating instances of "CustomParameter" java class.
Also
we would
like to get the XML represented by "CustomReturnObject" in the client
program
instead of the java object.
Can anybody help?
Thanks
Raghu -
Hi All,
I am developing a program to retrieve the GOS attachment from PO attachment and send to the vendor through email. Kindly advise me to resolve this problem because I have no idea how to retrieve the attachment from the GOS table.
Many thanks and best regards,
Ting Wei HongHi,
There is a class CL_GOS_MANAGER. Use that.
See here for an example:
data: o_gos type ref to cl_gos_manager.
data: o_att type ref to cl_gos_attachments.
data: ls_borident type borident.
ls_borident-objkey = gs_data-vgbel.
ls_borident-objtype = zcl_word=>co_busobject_worddocument.
free o_gos.
create object o_gos
exporting
ip_no_commit = space.
call method o_gos->start_service_direct
exporting
ip_service = 'VIEW_ATTA'
is_object = ls_borident
exceptions
no_object = 1
object_invalid = 2
execution_failed = 3
others = 4.
if sy-subrc <> 0.
message 'Geen bijlagen aanwezig. Toolbox wordt getoond' type 'S'.
o_gos->display_toolbox( is_object = ls_borident ).
else.
message 'Bijlagen aangepast' type 'S'.
endif. -
Hallo Gurus,
I need Your help!
Is it possible to use a Gos attachment in a Module Pool?
I have an image on material master data, and I would like to show it on a dynpro (for example with cl_gui_picture).
I have read the attachment with function SO_DOCUMENT_READ_API1 but then I don't know how to use the result.
Can anybody help me?
Thank you very much indeed!try
CALL FUNCTION 'SO_DOCUMENT_READ_API1
EXPORTING
DOCUMENT_ID = <doc>
FILTER = FILTER
IMPORTING
DOCUMENT_DATA = <DOCUMENT_DATA>
TABLES
OBJECT_HEADER = OBJECT_HEADER
OBJECT_CONTENT = OBJECT_CONTENT
* OBJECT_PARA =
* OBJECT_PARB =
* ATTACHMENT_LIST =
* RECEIVER_LIST =
CONTENTS_HEX = CONTENTS_HEX
EXCEPTIONS
DOCUMENT_ID_NOT_EXIST = 1
OPERATION_NO_AUTHORIZATION = 2
X_ERROR = 3
OTHERS = 4 -
Hi Experts,
I'm not ABAPer at all. Here are only my suppositions and please do not judge me strictly.
I need to upload PDF file as a GOS attachment to the QM notification from external system (SAP MII) using RFC. As I found out there is no remote-enabled FM for this. There is only SGOS_NOTE_CREATE for notes. I investigated it and found out that all FM's that are used inside it are remote-enabled.
Question: is it possible to call from my external system same 3 FMs as in SGOS_NOTE_CREATE (SO_FOLDER_ROOT_ID_GET, SO_OBJECT_INSERT, BINARY_RELATION_CREATE_COMMIT) to create attachment instead of note? I guess that in general i need to provide SO_OBJECT_INSERT with some other parameters than it is done in SGOS_NOTE_CREATE, so it will create attachment-object instead of note-object in SAPoffice. Is this way possible, or there should be more steps to create attachment?
thanks in advace,
PetrHi,
In the above code what is is_object and attachment parameters corresponds to. What are the values needs to used in this parameters.
data: l_object_id_loio type SDOKOBJECT,
l_object_id_phio type SDOKOBJECT.
call function 'SO_LOIO_PHIO_CREATE'
importing
loio_object = l_object_id_loio
phio_object = l_object_id_phio
exceptions
kpro_model_error = 103
x_error = 1000
others = 1000
call function 'SO_KPRO_DATA_INTO_OBJCONT_PUT'
exporting
loio_object = l_object_id_loio
tables
* CONTEXT =
objcont = i_objcont.
x_obj_data-file_ext = 'HTM'.
x_obj_data-OBJPRI = '5'.
x_obj_data-extct = 'K'.
x_obj_data-objla = sy-langu.
x_obj_data-objdes = '000004280212022400687486'. "wa_attach-filename.
x_obj_data-objlen = LINES( i_bin_data ) * 255. "i_soli_size. 000000007319
CONDENSE x_obj_data-objlen.
CONCATENATE '&SO_FILENAME=' '000004280212022400687486.htm' INTO x_objhead. "wa_attach-filename INTO wa_content.
APPEND x_objhead TO i_objhead.
x_objhead = '&SO_FORMAT=BIN' .
APPEND x_objhead TO i_objhead.
CALL FUNCTION 'SO_OBJECT_INSERT'
EXPORTING
folder_id = l_fol_id
object_hd_change = x_obj_data
object_type = 'EXT'
owner = sy-uname
IMPORTING
object_id = x_object_id
TABLES
objcont = i_objcont "&SO_KProObjectID=SOFFLOIO E2870D61F569E7F186CB0013216A31DB
objhead = i_objhead "&SO_FILENAME=000227964812102400687486.htm &SO_FORMAT=BIN
EXCEPTIONS
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
dl_name_exist = 4
folder_not_exist = 5
folder_no_authorization = 6
object_type_not_exist = 7
operation_no_authorization = 8
owner_not_exist = 9
parameter_error = 10
substitute_not_active = 11
substitute_not_defined = 12
system_failure = 13
x_error = 14
OTHERS = 15.
IF sy-subrc = 0 AND x_object-objkey IS NOT INITIAL.
x_folmem_k-foltp = l_fol_id-objtp.
x_folmem_k-folyr = l_fol_id-objyr.
x_folmem_k-folno = l_fol_id-objno.
x_folmem_k-doctp = x_object_id-objtp.
x_folmem_k-docyr = x_object_id-objyr.
x_folmem_k-docno = x_object_id-objno.
l_ep_note = x_folmem_k.
x_note-objtype = 'BKPF'. "c_message.
x_note-objkey = l_ep_note.
CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
EXPORTING
obj_rolea = x_object
obj_roleb = x_note
relationtype = 'ATTA'
EXCEPTIONS
OTHERS = 1.
I am using this code for attaching a .HTM external file automatically to a invoice document. But unable to attach it.
Can you please help.
Regards,
Rafi
Maybe you are looking for
-
How to attach search help in a particular field in se80 screen
Hi All, Can any one tell me how to attach a search help in a particular field in a screen. Wat search help is used to display material no and description Thanks in Advance Regards, Priya
-
Wrong java.library.path in Netbeans?
I write some java code and call native method with JNI, it does not work under netbeas, but work well in terminal. I try use System.out.println(System.getProperty("java.library.path")); to know what's wrong, i get two different output: netbeans: /usr
-
Macbook Pro (late 2008) with 8GB ram sporadic freezing / hanging
Hi, Last year, I was running Lion on my late 2008 MBP with 4GB ram with no problems. Whilst 4GB is the maximum officially supported for my machine, forum posts suggested that some people had no issues running it with 8GB. I went for the upgrade and
-
Cost Center and Profit Center in NewGL
Dear all, We defined new customer fileld in the NewGL for spliting the document number. Everything works fine! We have only one problem. Afer posting a new document we see the cost center and Profit center in the classic GL. When we change to NewGL i
-
I have been trying to download IOS 8.1.3 for a good 7 hours. I have been trying to download iTunes on my PC. To clarify, download IOS 8.1.3 on my iPhone. When installing, it says "An error occurred installing IOS 8.1.3." Please fix it. <Edited by Ho