Plsql client for twitter api (using oauth)

Hi,
I am probably being a bit optimistic, but does anybody have a plsql client for twitter that will allow me to post status updates from oracle? I found this http://somecodinghero.blogspot.com/2010/09/updating-twitter-from-database-using.html, but it doesn't work, simply giving me 401 Unauthorized whenver I try.
Make my day? Please?
Thanks
Ralph

So.... Are you ready? Let's go.....
Twitter Part:
1. Acess https://dev.twitter.com
2. Login
3. Create New Application
4. Fill out the data requested by twitter(and create application).
5. Click button "Create my acess token".
6. Copy Consumer key     ,Consumer secret     ,Access token     ,Access token secret     to Notepad++(or elsewhere).
7. Click the Tab Settings, and change Application Type to "Read, Write and Access direct messages". click the "Update..."
After installing DB and verified that you have Java 1.5 in your local machine and downloaded twitter4j jar.
1. Open Jdeveloper(i'm working with 11.1.2.1.0)
2. Create a new Application. Create a java Class with:
package client;
import twitter4j.*;
import twitter4j.conf.ConfigurationBuilder;
public class TweetMeMan {
    public static String sendTweet(String msg, String sOAuthConsumerKey, String sOAuthConsumerSecret, String  sOAuthAccessToken, String sOAuthAccessTokenSecret ) {
        String result = "Ok";       
        try {
            ConfigurationBuilder cb = new ConfigurationBuilder();
            cb.setOAuthConsumerKey(sOAuthConsumerKey);
            cb.setOAuthConsumerSecret(sOAuthConsumerSecret);
            cb.setOAuthAccessToken(sOAuthAccessToken);
            cb.setOAuthAccessTokenSecret(sOAuthAccessTokenSecret);           
            TwitterFactory tf = new TwitterFactory(cb.build());
            Twitter twitter = tf.getInstance();
            Status status = twitter.updateStatus(msg);
            System.out.println("Successfully updated the status to [" + status.getText() + "].");
        } catch (Exception e) {
            System.out.println("Error : " + e.getMessage());
            result = e.getMessage();
        return result;
}3. Click Project Settings and in Libraries add twitter4j(version).jar
4. Compile project. No errors? Nice.... Errors? Check the log and fix them ;)
5. Create a New Deployment Profile
5.1. Profle Type : Jar File
5.2 Deployment Profile Name : vrodriguestweet (in my case)
6. Deploy the vrodriguestweet (it will save de jar file in deploy folder)
7. Open command line (cmd.exe)
8. Write
loadjava -r -f -o -user vrodrigues/yourpaswword@YourDB your_location_of_the_jar_created_above\vrodriguestweet.jar9. Open Sqldeveloper(or sqlplus) and check if there is under Java this name exists : client/TweetMeMan
9.1 client is the java package i created the java file.
10. Now let's create the function:
CREATE FUNCTION letsTweetVR (p_message varchar2, p_OAuthConsumerKey varchar2, p_OAuthConsumerSecret varchar2, p_OAuthAccessToken varchar2, p_OAuthAccessTokenSecret varchar2  )
   RETURN VARCHAR2
   AS LANGUAGE JAVA
   NAME 'client/TweetMeMan.sendTweet
     (java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) return java.lang.String';   10.1. No errors? Amazing....keep going you are almost there...
11. Let's tweet:
BEGIN
  DBMS_OUTPUT.PUT_LINE(letsTweetVR('Tweeting from database...Awesome, right?',
                                          'your_OAuthConsumerKey',
                                         ' your_OAuthConsumerSecret',
                                         'your_OAuthAccessToken',
                                        'your_OAuthAccessTokenSecret')
END;Of course you can do this inside a package or passing the values from some interface.... And you can also do other things that twitter4j does... Like Search for Tweets and so on and so on. ;)
Did someone like this? Or i'm an idiot? : D
All credits goes to the developer of twitter4j....
P.S Remember that this is my first usage of java in DB...so if you can do better, please advise ;)
P.S.1. I will blog this with entire full steps.... just trying to get the time for it :/
https://lh6.googleusercontent.com/-ktXgF_N5rQU/Tz0hx8cEbgI/AAAAAAAAA-s/LOoTf_5pnd0/s864/twiiter.png
Edited by: Vitor Rodrigues on 16/Fev/2012 15:46

Similar Messages

  • Twitter api using data pooling

    Hi Team ,  I am planning to pool data from Twitter,Faceback. How to pool the data any API Available for this?                                        
                                                                                     

    Hello Rajkumar,
    Twitter do have an API (https://dev.twitter.com/docs/api/1.1), it requires OAuth though which Power Query AFAIK don't support (yet). See this thread for more info: http://social.technet.microsoft.com/Forums/sqlserver/en-US/6f51d906-294a-4eeb-8e52-10323ea3128c/power-query-and-twitter-api-11?forum=powerquery
    Facebook has limited support through built-in functionality in Power Query. http://office.microsoft.com/en-001/excel-help/connect-to-facebook-HA104019831.aspx
    Best regards,
    Daniel

  • Generate clients for multiple WSLDs using 'clientgen' task.

    Issue -
    I am trying to generate WS clients for multiple Services(WSDLs). I am using 'clientgen' task. But a 'clientgen'task accepts only one WSDL. If I have more one that one 'clientgen' task, some of the
    common classes (generated) are overwritten.
    For eg.
    WSDL for Contract 1
    <s:element name="executeResponse">
    <s:complexType>
    <s:sequence>
    <s:element ref="soa:CancelOrderResponse"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <message name="executeSoapOut">
    <part name="parameters" element="s0:executeResponse"/>
    </message>
    <portType name="CancelOrderSoap">
    <operation name="execute">
    <input message="s0:executeSoapIn"/>
    <output message="s0:executeSoapOut"/>
    </operation>
    </portType>
    <service name="CancelOrder">
    <port name="CancelOrderSoap" binding="s0:CancelOrderSoap">
    <soap:address location="http://localhost:7001/CoreWSProject/sync/CancelOrder.jws"/>
    </port>
    </service>
    WSDL for Contract 2
    <s:element name="executeResponse">
    <s:complexType>
    <s:sequence>
    <s:element ref="soa:CancelOrderResponse"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <message name="executeSoapOut">
    <part name="parameters" element="s0:executeResponse"/>
    </message>
    <portType name="CancelOrderSoap">
    <operation name="execute">
    <input message="s0:executeSoapIn"/>
    <output message="s0:executeSoapOut"/>
    </operation>
    </portType>
    <service name="CancelOrder">
    <port name="CancelOrderSoap" binding="s0:CancelOrderSoap">
    <soap:address location="http://localhost:7001/CoreWSProject/sync/CancelOrder.jws"/>
    </port>
    </service>
    GENERATED CODE
    A class ExecuteResponse will be generated for each service. This class gets overwritten if you use
    multiple 'clientgen' tasks.
    Question
    Is there way to specify multiple WSDLs in 'clientgen' task so that i should be able to package
    all the clientcode in one jar without any namespace issues ?
    - Sandeep V

    If the classes have the same namespace, by default, the same Java package name will be created. There is a packageName attribute on the clientgen Ant task, which provides some control over the Java package name that is used.
    There is no way to specify multiple WSDLs to the clientgen Ant task. This makes sense if you subscribe to the notion that a WSDL represents a Web Service. It sounds like you can achieve what you want by:
    1. Running clientgen on the first WSDL,
    2. Use Ant to extract the contents of the generated JAR into a directory (with a name like clientgen),
    3. Running clientgen on the next WSDL,
    4. Use Ant to extract the contents of the generated JAR into the same clientgen directory,
    5. etc, etc.
    Afterwards, you would just need to use Ant to JAR up the clientgen directory. Again, you'll want to specify a different packageName attribute for each WSDL.
    HTH,
    Mike Wooten

  • Example for Tagging API using EJB3.0 on Jboss Application Server

    Hello Friends
    In EJB 3.0 development I am searching for Taging API implementation using JBOSS application server and Netbeans 5.
    If anyone has tutorial to do so please post the link.
    Thanks in advance.
    Ravi Phulari

    Hello Friends
    In EJB 3.0 development I am searching for Taging API implementation using JBOSS application server and Netbeans 5.
    If anyone has tutorial to do so please post the link.
    Thanks in advance.
    Ravi Phulari

  • Generate ws client for horde rpc using netbeans

    Hallo developers,
    I'd like to access my horde using webservices rcp (http://netvor.sk/horde/rpc.php?wsdl). I am new to ws so i rely on netbeans to generate client for me. Unfortunately it failed :-(
    Among other, wsdl describes messages of type xsd:resource and xsd:object (xsd is http://www.w3.org/2001/XMLSchema) like:<message name="mail.getStreamResponse">
    <part name="output" type="xsd:resource" />
    </message>as a result wscompile dies because resource is not defined in XMLSchema dtd. like: invalid entity name: "resource" (in namespace: "http://www.w3.org/2001/XMLSchema")
    I have jdk6 with bundled ws support and nb5.5. with JAX_RCP 1.6 library.
    How do I use these message of (custom?) type? Best using some wsimport/wscompe 'options' or maybe fallback to older java version -- I don't have time to 'play' with this (it's not my primary goal) so writing any code is ... aldo i fear that this is some sort of advanced topic and i'll have to study ws more that i'd like to :-)
    ~~
    Adam

    If this is not an rpc/encoded WSDL, you should try to use JAX-WS as it supports 100% of schema and is much better than JAX-WS. Check out http://jax-ws.dev.java.net for more information on JAX-WS. Best of all, JAX-WS is part of JDK 6.

  • CF Library for Twitter API

    Hey ColdFusion developers.  Haven't been active on the forums in quite a few years, but what the heck right.
    The last few months I've been knee deep in a Twitter API integration, and low and behold a nifty little component/function set was developed along the way.  So I figured there's gotta be more than a few other CF Developers out there who might benefit from a library such as this one.
    Hope you enjoy...
    http://www.bleubrain.com/www/apps/twitterCOM/
    Thanks,
    Quinn

    If you are not aware of it, you may want to check out RIA Forge for ColdFusion Community tools like yours.
    http://riaforge.org/

  • Accessing sharepoint REST api using S2S authentication

    Hi, I'm trying to access the SharePoint REST APIs (One-Drive for business) using the access token retrieved from S2S authentication flow (https://msdn.microsoft.com/en-us/library/azure/dn645543.aspx).
    Currently, I'm getting the following exception:
    he server was unable to process the request due to an internal error.  For more information about
    the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the
    Microsoft .NET Framework SDK documentation and inspect the server trace log
    Is this scenario (app auth instead of delegate auth) support for those set of APIs?
    Thanks

    Hi,
    According to your description, my understanding is that you want to access SharePoint Online One-Drive for business API using OAuth 2.0 authentication.
    In summary, Rest API can work with OAuth 2.0 authentication.
    Here are some detailed articles about access Rest API with OAuth 2.0 authentication:
    OAuth 2.0 Compliant REST API
    Securing RESTful Web Services with OAuth2
    About accessing One-Drive for business with Rest API, you can refer the article below:
    Access OneDrive for Business using the SharePoint 2013 APIs
    About the error message, I suggest you can use Fiddler to track the web request to find detailed message:
    Fiddler
    Thanks
    Best Regards,
    Jerry Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Problem with DII client for Doc/Literal with non built-in type in WL8.1 Sp2

    Hello,
    I have been trying to make this DII client for doc/literal using non built-in type to work for 2 days now.
    Any help/input will be greatly appreciated. I have added the code and wsdl below.
    BTW this is using the code first approach.
    Works perfectly fine with the clientgen generated stubs. But not with DII.
    With the stubs, following is the SOAP envelope.
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header/>
    <env:Body>
    <n1:getType xmlns:n1="http://www.aeb.com/wlws">
         <n2:id xmlns:n2="java:com.aeb.types">XYS</n2:id>
         <n3:name xmlns:n3="java:com.aeb.types">Name</n3:name>
    </n1:getType>
    </env:Body>
    </env:Envelope>
    With DII (using the serializer/deserializer generated by clientgen),
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header/>
    <env:Body>
    <n1:TestType xmlns:n1="java:com.aeb.types">
         <n1:id>ABC</n1:id>
         <n1:name>Some Name</n1:name>
    </n1:TestType>
    </env:Body></env:Envelope>
    Exception
    javax.xml.rpc.soap.SOAPFaultException: Unable to find a matching Operation for this remote invocation
    <n1:TestType xmlns:n1="java:com.aeb.types">
    <n1:id>ABC</n1:id>
    <n1:name>Some Name</n1:name>
    </n1:TestType>.
         Please check your operation name.
         at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:313)
         at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
         at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
         at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
         at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:558)
         at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:411)
         at com.amgen.webservice.clients.DocClient.callService(DocClient.java:83)
         at com.amgen.webservice.clients.DocClient.main(DocClient.java:35)
    Client
    System.setProperty("javax.xml.rpc.ServiceFactory","weblogic.webservice.core.rpc.ServiceFactoryImpl");
    System.setProperty("weblogic.webservice.verbose", "true");
    String targetNamespace = "http://www.aeb.com/wlws";
    ServiceFactory factory = ServiceFactory.newInstance();
    QName serviceName = new QName(targetNamespace, "DocWebservice");
    QName portName = new QName(targetNamespace, "DocWebservicePort");
    QName operationName = new QName(targetNamespace, "getType");
    Service service = factory.createService(serviceName);
    TypeMappingRegistry registry = service.getTypeMappingRegistry();
    TypeMapping mapping = registry.getTypeMapping(SOAPConstants.URI_NS_SOAP_ENCODING);
    mapping.register(TestType.class, new QName("java:com.aeb.types","TestType"), new TestTypeCodec(), new TestTypeCodec());
    Call call = service.createCall();
    call.setOperationName(operationName);
    call.setPortTypeName(portName);
    call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
    call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
    call.setProperty(Call.OPERATION_STYLE_PROPERTY, "document");
    call.addParameter("testType", new QName("java:com.aeb.types","TestType"), TestType.class, ParameterMode.IN);
    call.setReturnType(new QName("java:com.aeb.types", "TestType"),TestType.class);
    call.setTargetEndpointAddress("http://localhost:7001/wlws/DocWebservice");
    TestType type = new TestType();
    type.setId("ABC");
    type.setName("Some Name");
    TestType res = (TestType) call.invoke(new Object[] { type });
    System.out.println(res.getName());
    TestType.java
    package com.aeb.types;
    import java.io.Serializable;
    public class TestType implements Serializable {
         private String id;
         private String name;
         public String getId() {
              return id;
         public void setId(String id) {
              this.id = id;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
    DocWebservice.java
    package com.aeb.webservices;
    import com.aeb.types.TestType;
    public class DocWebservice {
         public TestType getType(TestType type) {
              System.out.println("In Server....");
              System.out.println("Received : " + type.getName());
              return type;
    ServiceGen Ant Task
    <servicegen destear="${dist.dir}/wlws.ear" contexturi="wlws">
         <service javaClassComponents="com.aeb.webservices.DocWebservice"
              generateTypes="True"
              targetNamespace="http://www.aeb.com/wlws"
              serviceName="DocWebservice"
              serviceURI="/DocWebservice"
              style="document">
              <client packageName="com.aeb.ws.doc.client" />
         </service>
    </servicegen>
    WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns:tns="http://www.aeb.com/wlws" xmlns:wsr="http://www.openuri.org/2002/10/soap/reliability/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:soap12enc="http://www.w3.org/2003/05/soap-encoding" xmlns:conv="http://www.openuri.org/2002/04/wsdl/conversation/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.aeb.com/wlws">
    <types xmlns:tns="http://www.aeb.com/wlws"
    xmlns:wsr="http://www.openuri.org/2002/10/soap/reliability/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:soap12enc="http://www.w3.org/2003/05/soap-encoding"
    xmlns:conv="http://www.openuri.org/2002/04/wsdl/conversation/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.xmlsoap.org/wsdl/">
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:stns="http://www.aeb.com/wlws"
    xmlns:tp="java:com.aeb.types"
    elementFormDefault="qualified"
    attributeFormDefault="qualified"
    targetNamespace="http://www.aeb.com/wlws">
    <xsd:import namespace="java:com.aeb.types">
    </xsd:import>
    <xsd:element xmlns:tp="java:com.aeb.types"
    type="tp:TestType"
    name="getType"
    nillable="true">
    </xsd:element>
    <xsd:element xmlns:tp="java:com.aeb.types"
    type="tp:TestType"
    name="getTypeResponse"
    nillable="true">
    </xsd:element>
    </xsd:schema>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:stns="java:com.aeb.types"
    elementFormDefault="qualified"
    attributeFormDefault="qualified"
    targetNamespace="java:com.aeb.types">
    <xsd:complexType name="TestType">
    <xsd:sequence>
    <xsd:element type="xsd:string"
    name="id"
    minOccurs="1"
    maxOccurs="1"
    nillable="true">
    </xsd:element>
    <xsd:element type="xsd:string"
    name="name"
    minOccurs="1"
    maxOccurs="1"
    nillable="true">
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    </types>
    <message name="getType">
    <part xmlns:partns="http://www.aeb.com/wlws"
    name="testType"
    element="partns:getType">
    </part>
    </message>
    <message name="getTypeResponse">
    <part xmlns:partns="http://www.aeb.com/wlws"
    name="result"
    element="partns:getTypeResponse">
    </part>
    </message>
    <portType name="DocWebservicePort">
    <operation name="getType">
    <input message="tns:getType">
    </input>
    <output message="tns:getTypeResponse">
    </output>
    </operation>
    </portType>
    <binding type="tns:DocWebservicePort"
    name="DocWebservicePort">
    <soap:binding style="document"
    transport="http://schemas.xmlsoap.org/soap/http">
    </soap:binding>
    <operation name="getType">
    <soap:operation style="document"
    soapAction="">
    </soap:operation>
    <wsr:reliability persistDuration="60000">
    </wsr:reliability>
    <input>
    <soap:body namespace="http://www.aeb.com/wlws"
    use="literal">
    </soap:body>
    </input>
    <output>
    <soap:body namespace="http://www.aeb.com/wlws"
    use="literal">
    </soap:body>
    </output>
    </operation>
    </binding>
    <service name="DocWebservice">
    <port name="DocWebservicePort"
    binding="tns:DocWebservicePort">
    <soap:address location="http://localhost:7001/wlws/DocWebservice">
    </soap:address>
    </port>
    </service>
    </definitions>
    Thanks
    Aspert

    Hello,
    I have been trying to make this DII client for doc/literal using non built-in type to work for 2 days now.
    Any help/input will be greatly appreciated. I have added the code and wsdl below.
    BTW this is using the code first approach.
    Works perfectly fine with the clientgen generated stubs. But not with DII.
    With the stubs, following is the SOAP envelope.
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header/>
    <env:Body>
    <n1:getType xmlns:n1="http://www.aeb.com/wlws">
         <n2:id xmlns:n2="java:com.aeb.types">XYS</n2:id>
         <n3:name xmlns:n3="java:com.aeb.types">Name</n3:name>
    </n1:getType>
    </env:Body>
    </env:Envelope>
    With DII (using the serializer/deserializer generated by clientgen),
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header/>
    <env:Body>
    <n1:TestType xmlns:n1="java:com.aeb.types">
         <n1:id>ABC</n1:id>
         <n1:name>Some Name</n1:name>
    </n1:TestType>
    </env:Body></env:Envelope>
    Exception
    javax.xml.rpc.soap.SOAPFaultException: Unable to find a matching Operation for this remote invocation
    <n1:TestType xmlns:n1="java:com.aeb.types">
    <n1:id>ABC</n1:id>
    <n1:name>Some Name</n1:name>
    </n1:TestType>.
         Please check your operation name.
         at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:313)
         at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
         at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
         at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
         at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:558)
         at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:411)
         at com.amgen.webservice.clients.DocClient.callService(DocClient.java:83)
         at com.amgen.webservice.clients.DocClient.main(DocClient.java:35)
    Client
    System.setProperty("javax.xml.rpc.ServiceFactory","weblogic.webservice.core.rpc.ServiceFactoryImpl");
    System.setProperty("weblogic.webservice.verbose", "true");
    String targetNamespace = "http://www.aeb.com/wlws";
    ServiceFactory factory = ServiceFactory.newInstance();
    QName serviceName = new QName(targetNamespace, "DocWebservice");
    QName portName = new QName(targetNamespace, "DocWebservicePort");
    QName operationName = new QName(targetNamespace, "getType");
    Service service = factory.createService(serviceName);
    TypeMappingRegistry registry = service.getTypeMappingRegistry();
    TypeMapping mapping = registry.getTypeMapping(SOAPConstants.URI_NS_SOAP_ENCODING);
    mapping.register(TestType.class, new QName("java:com.aeb.types","TestType"), new TestTypeCodec(), new TestTypeCodec());
    Call call = service.createCall();
    call.setOperationName(operationName);
    call.setPortTypeName(portName);
    call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
    call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
    call.setProperty(Call.OPERATION_STYLE_PROPERTY, "document");
    call.addParameter("testType", new QName("java:com.aeb.types","TestType"), TestType.class, ParameterMode.IN);
    call.setReturnType(new QName("java:com.aeb.types", "TestType"),TestType.class);
    call.setTargetEndpointAddress("http://localhost:7001/wlws/DocWebservice");
    TestType type = new TestType();
    type.setId("ABC");
    type.setName("Some Name");
    TestType res = (TestType) call.invoke(new Object[] { type });
    System.out.println(res.getName());
    TestType.java
    package com.aeb.types;
    import java.io.Serializable;
    public class TestType implements Serializable {
         private String id;
         private String name;
         public String getId() {
              return id;
         public void setId(String id) {
              this.id = id;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
    DocWebservice.java
    package com.aeb.webservices;
    import com.aeb.types.TestType;
    public class DocWebservice {
         public TestType getType(TestType type) {
              System.out.println("In Server....");
              System.out.println("Received : " + type.getName());
              return type;
    ServiceGen Ant Task
    <servicegen destear="${dist.dir}/wlws.ear" contexturi="wlws">
         <service javaClassComponents="com.aeb.webservices.DocWebservice"
              generateTypes="True"
              targetNamespace="http://www.aeb.com/wlws"
              serviceName="DocWebservice"
              serviceURI="/DocWebservice"
              style="document">
              <client packageName="com.aeb.ws.doc.client" />
         </service>
    </servicegen>
    WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns:tns="http://www.aeb.com/wlws" xmlns:wsr="http://www.openuri.org/2002/10/soap/reliability/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:soap12enc="http://www.w3.org/2003/05/soap-encoding" xmlns:conv="http://www.openuri.org/2002/04/wsdl/conversation/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.aeb.com/wlws">
    <types xmlns:tns="http://www.aeb.com/wlws"
    xmlns:wsr="http://www.openuri.org/2002/10/soap/reliability/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:soap12enc="http://www.w3.org/2003/05/soap-encoding"
    xmlns:conv="http://www.openuri.org/2002/04/wsdl/conversation/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.xmlsoap.org/wsdl/">
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:stns="http://www.aeb.com/wlws"
    xmlns:tp="java:com.aeb.types"
    elementFormDefault="qualified"
    attributeFormDefault="qualified"
    targetNamespace="http://www.aeb.com/wlws">
    <xsd:import namespace="java:com.aeb.types">
    </xsd:import>
    <xsd:element xmlns:tp="java:com.aeb.types"
    type="tp:TestType"
    name="getType"
    nillable="true">
    </xsd:element>
    <xsd:element xmlns:tp="java:com.aeb.types"
    type="tp:TestType"
    name="getTypeResponse"
    nillable="true">
    </xsd:element>
    </xsd:schema>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:stns="java:com.aeb.types"
    elementFormDefault="qualified"
    attributeFormDefault="qualified"
    targetNamespace="java:com.aeb.types">
    <xsd:complexType name="TestType">
    <xsd:sequence>
    <xsd:element type="xsd:string"
    name="id"
    minOccurs="1"
    maxOccurs="1"
    nillable="true">
    </xsd:element>
    <xsd:element type="xsd:string"
    name="name"
    minOccurs="1"
    maxOccurs="1"
    nillable="true">
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    </types>
    <message name="getType">
    <part xmlns:partns="http://www.aeb.com/wlws"
    name="testType"
    element="partns:getType">
    </part>
    </message>
    <message name="getTypeResponse">
    <part xmlns:partns="http://www.aeb.com/wlws"
    name="result"
    element="partns:getTypeResponse">
    </part>
    </message>
    <portType name="DocWebservicePort">
    <operation name="getType">
    <input message="tns:getType">
    </input>
    <output message="tns:getTypeResponse">
    </output>
    </operation>
    </portType>
    <binding type="tns:DocWebservicePort"
    name="DocWebservicePort">
    <soap:binding style="document"
    transport="http://schemas.xmlsoap.org/soap/http">
    </soap:binding>
    <operation name="getType">
    <soap:operation style="document"
    soapAction="">
    </soap:operation>
    <wsr:reliability persistDuration="60000">
    </wsr:reliability>
    <input>
    <soap:body namespace="http://www.aeb.com/wlws"
    use="literal">
    </soap:body>
    </input>
    <output>
    <soap:body namespace="http://www.aeb.com/wlws"
    use="literal">
    </soap:body>
    </output>
    </operation>
    </binding>
    <service name="DocWebservice">
    <port name="DocWebservicePort"
    binding="tns:DocWebservicePort">
    <soap:address location="http://localhost:7001/wlws/DocWebservice">
    </soap:address>
    </port>
    </service>
    </definitions>
    Thanks
    Aspert

  • Create Oauth signituare for twitter in as3?

    Hi,
    Since twitter locked down the api, im finding it really hard to grab the data I want.I need to use Oauth.
    Because I dont actually need to link a twitter users account to my application (only the applications twitter account) it makes things a little easier as the twitter application page will create an access token and a access token secret for it. So I have those variables.
    All i need to do is to create the signature which seems incredibly difficult.
    https://dev.twitter.com/docs/auth/creating-signature
    Does anyone no of a class/swc that I can push the required variables to and have it create the signature for me?
    Thanks
    Aidan

    you can use Tweetr (http://wiki.swfjunkie.com/tweetr), but if you get security sandbox errors you'll need to download the source files and you'll need to edit the source files.  instead of loading cross-domain data using urlloader, use a gateway php file that does the cross-domain loading:
    <?php
    $requestURL = $_POST['requestURL'];
    $cr = curl_init($requestURL);
    curl_setopt($cr, CURLOPT_RETURNTRANSFER, true);
    $returnS = curl_exec($cr);
    curl_close($cr);
    echo $returnS;
    ?>

  • How to post to Twitter using oAuth and UTL_HTTP

    I've come across the ORA_TWEET package by Lewis Cunningham.
    But when I try to use it I get an error code 34.
    It looks like the Authentication method for twitter has changed to use the oAuth API.
    Does any know of some sample code that shows how to do this?
    Thx

    Put your question to Lewis.
    You provided so little information, here, it is impossible to help you.

  • SAPUI5 sending tweet using twitter API

    Hello Experts,
    I was wondering if i could simply tweet something from SAPUI5 directly onto twitter ?
    I just want to have a textarea where i put in my tweet's text, and then i just push the button tweet.
    Any of you have more information regarding this ?
    Kind Regards,
    Bart

    Hi,
    you can use twitter API to create SAPUI5 application. you will find more information at Overview: Version 1.1 of the Twitter API | Twitter Developers
    But it requires API key and OAuth access. earlier I developed few application based on JSON Rest APIs. you will find more info on this blog Creating SAPUI5 Applications based on Public JSON APIs or Web Services
    also check this blog UI5 & Twitter - Designing the Solution from Gareth Ryan related to this subject.
    Regards,
    Chandra

  • Is there any API's for providing FTP using ssh port.

    Currently we are having a requirement to FTP files only using ssh port(Secure FTP). Can anyone please suggest me an API which provides the FTP'ing operation using SSH port.

    I am currently using a Sinetfactory thirdparty package from JScape for the Secure FTP functionality(FTP over SSH). But Sinetfactory package tranfer rate is much slower than the manual sftp(command-line run in linux server for manual ftp using ssh).
    Since it is very slower than ordinary sftp(ftp over ssh), I thought of using other thirdparty FTP package which supports FTP using ssh port. Can anyone please suggest me a thirdparty package which will has the sftp functionality and with better transfer rate.

  • Wired mac using Express as client for Snow base?

    Hello All,
    Is it possible to plug a non-Airport Mac into the Ethernet port of the Express and essentially use it as a client for an existing older Airport network (Snow base station)?

    No. This requires a WDS and the Snow base station doesn't support WDS.

  • Using SUN Ray thin client for UCCE CAD Agents

    Hi,
    Does anyone tested the thin client SUN Ray for  Cisco Agent Desktops? Is this supported by Cisco?
    We know that  Cisco supports Citrix for Cisco Agent Desktop but using thin client for  IP Communicator is not supported at all.
    Thanks.

    I guess it all depends on what the SunRay client is connecting to? If it's a VDI, terminal server, or something else as long as that platform is supported by Cisco/CAD then it should be okay - after all the SunRay is just a way of connecting to a desktop environment that then runs the CAD software.
    Hope you're SunRay deployment goes well!
    Jeff

  • Create new tag for selected text using API?

    Hello,
    I want to add new tag for the selected text just like 'Create Tag from selection' .
    is it possible to create tag for selected text using acrobat api?
         please,help me.

    As per sample of snippetRunner for adding tag for selected text.
    I tried below code
    PDPage pg;
    AVDoc avDoc = AVAppGetActiveDoc();
    PDDoc pd = AVDocGetPDDoc(avDoc);
        pg = PDDocAcquirePage(pd, 0);
    ASAtom theSelectionType = AVDocGetSelectionType(avDoc);
    if (theSelectionType == ASAtomFromString("Text")){
        PDTextSelect ts = static_cast<PDTextSelect>(AVDocGetSelection(avDoc));
        PDSTreeRoot pdsTreeRoot;
        CosObj pageObj = PDPageGetCosObj (pg);
        PDSElement newElem;
        PDSElementCreate(pd, &newElem);
        char buf1[64];
        strcpy (buf1, "A new structure element");
        // set its type as "Document" standard type
        PDSElementSetType(newElem, ASAtomFromString ("Document"));
        // set its title
        PDSElementSetTitle(newElem, reinterpret_cast<const ASUns8*> (buf1), strlen(buf1));
        PDSTreeRootInsertKid (pdsTreeRoot, aElem, kPDSAfterLast);
        PDSElementInsertMCAsKid // here something i have to add
    If i have PDTextSelect how i can add tag for selected text.like user add tag using "CreateTagForSelectedText" option.
    please,help me.
    thanks.

Maybe you are looking for