Call a rest service in a WADL via browser

  • I have to call a rest service declared in a WADL but i dont know how to read the file on the description.

    This is the file description for the service :

    -<resources base="http://xxxxxxxxxxxx:8000/webservices/rest/User/">
    -<resource path="change_user_name/">
    -<method name="POST" id="CHANGE_USER_NAME">
    <representation type="CHANGE_USER_NAME_Input" mediaType="application/xml"/>
    <representation type="CHANGE_USER_NAME_Input" mediaType="application/json"/>
    -<resource path="isuseractive__1/">
    -<method name="POST" id="ISUSERACTIVE__1">
    <representation type="ISUSERACTIVE__1_Input" mediaType="application/xml"/>
    <representation type="ISUSERACTIVE__1_Input" mediaType="application/json"/>
    <representation type="ISUSERACTIVE__1_Output" mediaType="application/xml"/>
    <representation type="ISUSERACTIVE__1_Output" mediaType="application/json"/>

    And this is the detail description for that method

    <import schemaLocation="http://xxxxxxxxxxxxxxx:8000/webservices/rest/User/?XSD=RESTHeader.xsd" namespace=""/>
    -<element name="InputParameters">
    <element db:type="VARCHAR2" type="string" name="P_USERNAME" nillable="true" minOccurs="0" db:index="1"/>

    I have tried calling the service with POSTMAN :






    and it works fine.

    But when i try it with a browser call, i get a 400 error page.

    I tried


    and more combinations, but nothing worked.

Log in to reply



  • S

    I need to preserve <div> tags as they are loaded into the quill editor but still use <p> tags as the primary paragraph tag

    So this is my html.

    <div class="someclass"> <p> <strong>something bold</strong> lorem. </p> </div>

    Let's say I start typing, I need the resultant HTML to be:

    <div class="someclass"> <p> <strong>something bold</strong> lorem. </p> <p><br></p> <p> More text </p> </div>

    I have found how to configure quill to use div tags instead of p tags.

    How can I configure quill to keep using p tags but preserve div tags?

    read more
  • S

    Here below, pass the array into Polymer. And after modifications pass the array outside ;



    static get template() { return html` <template is="dom-repeat" items="[[users]]"><p>{{item}}</p></template> <paper-button on-tap="_clickMe">STEP -2 Pass the array outside </paper-button> `; } _clickMe () { this.push('users', 'Last Test') this._arrayChanged(); } _arrayChanged(){ this.dispatchEvent(new CustomEvent('array-changed', { bubbles: true, composed: true, detail: this.users })); } } customElements.define('my-element', MyElement);


    <button id="button" onClick="_sendDataIntoPolymer()">STEP -1 Send data into Polimer.</button> <br> <my-element id="myelement" users="{{users}}"></my-element> <pre id="preview"> Arrray outside <script> function _sendDataIntoPolymer(){ document.getElementById('myelement').users = ['test1','test2','test3','test4'] } document.addEventListener('array-changed', arr=>{ document.getElementById('preview').innerHTML += arr.detail })

    EDIT: Or add an observer in order to pass array outside upon modified:

    static get observers() {return ['_arrayChanged(users.*)']; } _arrayChanged(){ this.dispatchEvent(new CustomEvent('array-changed', { bubbles: true, composed: true, detail: this.users })); }

    read more
  • S

    If I understand your code correctly users are defined somewhere out of scope of where you are using it. Can you link to a location where the code is running?

    read more
  • S

    How to mutate an array passed from an external html file in a polymer web component

    As stated here, when the array is reated inside the component it can be accessed. My question is how to access the passed array

    html code: {% extends 'base.html' %} {% block title %}Welcome {% endblock %} {% block content %} <h1>Testtt</h1> <a href="{% url 'login' %}">login</a> <a href="{% url 'signup' %}">signup</a> <button-element title='test'></button-element> <dropdown-element users='{{users}}'></dropdown-element> {% if users %} <p>test</p> <p>{{ users }}</p> <p>{{ users.1 }}</p> {% endif %} {% endblock %} base.html <!-- templates/base.html --> {% load static %} {% load polymerdep %} <html> <head> <meta charset="utf-8"> <title>{% block title %}Django {% endblock %}</title> <link rel="stylesheet" href=""> <script src=""></script> <script src=""></script> <script src=""></script> <script src="{% static "node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js" %}"></script> <script type="module" src="{% static "src/components-app/dropdown-element.js" %}"></script> {% block link %} {% endblock %} </head> <body> <main> {% block content %} {% endblock %} </main> </body> </html> array Contents users=['test1','test2','test3','test4'] polymer js file import { html, PolymerElement } from '../../node_modules/@polymer/polymer/polymer-element.js'; import '../../node_modules/@polymer/polymer/lib/elements/dom-repeat.js'; /** * @customElement * @polymer */ class DropdowmElement extends PolymerElement { static get template() { return html` <style> </style> <template is="dom-repeat" items="[[users]]"><p>{{item}}</p></template> `; } static get properties() { return { users: { type: Array, } } } constructor() { super(); } } window.customElements.define('dropdown-element', DropdowmElement);

    The data is loading in html file and no errors are listed in console

    read more
  • S

    I have used behat many times in the past and today I've just got behat and selenium running headless chrome to make BDD acceptance features for custom development in Magento 2. Previous methods have either been custom to the framework I'm using or have used Carbon and code looks like...

    //Carbon Carbon::setTestNow(Carbon::create(2001, 5, 21, 12)); //Silverstripe Framework SS_Datetime::set_mock_now('2003-11-01 12:12:12')

    ...and having done this the entire application would then use this as the current date/time, including things like the ORM where it would update "created" times on database records. I am now looking for the same thing within Magento CE 2.2.7 and have so far not found what I'm looking for. There is a dev doc page that hints at this stating...

    Whenever your code requires access to some part of the environment, try to use a collaborator class that can easily be replaced by a test double (also referred to as a mock) instead. For example, if you… …need the current time? Inject a \DateTimeInterface instance (for example \DateTimeImmutable) and use that.

    ...however it doesn't seem to include any more information and after searching the code for this I'm still confused if there is a simple way to ensure the global system date-time is mocked or faked in this way so that I can...

    Make an order on day 1 Move forward a day and process the order on day 2 Move forward a week and customer marks the order for return on day 9 etc.

    Can anyone please help me with this?

    read more